标题: C# 使用DataView实现Distinct效果-DISTINCT rows in a DataTable or DataView [打印本页] 作者: 资讯王 时间: 2011-1-14 09:21 标题: C# 使用DataView实现Distinct效果-DISTINCT rows in a DataTable or DataView C# 利用DataView来过过滤DataTable达到SQL Query的Distinct效果 DISTINCT rows in a DataTable or DataView
DataView dv = dtOriginalDataTable.DefaultView; //取得DataTable的数据 Get Data From DataTable
DataTable dt = dv.ToTable(true, "Category"); //你能添加更多 To add more if u want ToTable(true, "Category", "Product")