码迷,mamicode.com
首页 > 其他好文 > 详细

DataTable 中Distinct操作

时间:2015-06-01 14:33:57      阅读:113      评论:0      收藏:0      [点我收藏+]

标签:

 

 

 

 DataTable dt = ds.Tables[0];
 DataView dataView = dt.DefaultView;
 DataTable dtDistinct = dataView.ToTable(true, "GC002_UserID", "GC002_UserName","字段3","字段3","字段5");//DataTable根据 UserID去掉重复的
//ToTable中最终填写的的字段 最终会在dtDistinct的列内包含,其他没有填写的字段将不在包含

 

DataTable 中Distinct操作

标签:

原文地址:http://www.cnblogs.com/wangjunwei/p/4543854.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!