DataTable 中Distinct操作

 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的列内包含,其他没有填写的字段将不在包含
原文地址:https://www.cnblogs.com/wangjunwei/p/4543854.html