DataTable dataSource = new DataTable();
var result = (from d in dataSource.AsEnumerable() select d["id"]).Distinct();
DataTable newTable = new DataTable();
foreach (var item in result)
{
newTable.Rows.Add(item);
}
linq是用来查询的,不能实现移除。
Linq.Distinct()吧