有时候需要取得DataTable中distinct 某些列的后的DataTable. 因为DataTable 没有直接 的distinct 方法.我们可以利用DataView 的ToTable方法.
如:
dt.DefaultView.ToTable(true, new string[] {"AA","BB" });
true表示需要distinct , AA,BB 表示distinct 的栏位.
有时候需要取得DataTable中distinct 某些列的后的DataTable. 因为DataTable 没有直接 的distinct 方法.我们可以利用DataView 的ToTable方法.
如:
dt.DefaultView.ToTable(true, new string[] {"AA","BB" });
true表示需要distinct , AA,BB 表示distinct 的栏位.
转载于:https://www.cnblogs.com/andycai/archive/2011/06/21/2086352.html