DataTable distinct 功能

有时候需要取得DataTable中distinct 某些列的后的DataTable. 因为DataTable 没有直接  的distinct 方法.我们可以利用DataView 的ToTable方法.

如:

dt.DefaultView.ToTable(true, new string[] {"AA","BB" });

true表示需要distinct , AA,BB 表示distinct 的栏位.

 

 

posted on 2011-06-21 20:18  AndyCai  阅读(376)  评论(1编辑  收藏  举报

导航