//去掉重复行
DataTable table=new DataTable();
DataView dv = table.DefaultView;
table = dv.ToTable(true, new string[] { "name", "code" });
此时table 就只有name、code无重复的两行了,如果还需要id值则
table = dv.ToTable(true, new string[] { "id","name", "code" });//第一个参数true 启用去重复,类似distinct
详情查看:http://www.cnblogs.com/wifi/archive/2013/02/19/2916565.html