DataTable dt //你的DataTable数据
DataView dv = new DataView(dt);//视图
DataTable dt1= dv.ToTable(true, new string[]{"CourseId","TeacherId"});//true 表示是去重 string[]是要去重的列CourseId和TeacherId都一样才去掉重复
dt1就是去重后的DataTable
2022-03-10 02:40:57
DataTable dt //你的DataTable数据
DataView dv = new DataView(dt);//视图
DataTable dt1= dv.ToTable(true, new string[]{"CourseId","TeacherId"});//true 表示是去重 string[]是要去重的列CourseId和TeacherId都一样才去掉重复
dt1就是去重后的DataTable
下一篇:sql月份销售统计