标签:val ons add 销售人员 count type name view bsp
DataTable dt = new DataTable();
DataColumn c1 = new DataColumn("CompanyName", typeof(string));//公司名称
DataColumn c2 = new DataColumn("MainBusiness", typeof(string));//公司业务
DataColumn c3 = new DataColumn("SaleName", typeof(string));//销售人员
dt.Columns.AddRange(new DataColumn[]{c1,c2,c3});
DataRow r1 = dt.NewRow();
r1["CompanyName"] = "公司A";
r1["MainBusiness"] = "公司A业务";
r1["SaleName"] = "张三";
dt.Rows.Add(r1);
DataRow r2 = dt.NewRow();
r2["CompanyName"] = "公司A";
r2["MainBusiness"] = "公司A业务";
r2["SaleName"] = "李四";
dt.Rows.Add(r2);
DataRow r3 = dt.NewRow();
r3["CompanyName"] = "公司B";
r3["MainBusiness"] = "公司B业务";
r3["SaleName"] = "王五";
dt.Rows.Add(r3);
//去重处理
DataView dv = new DataView(dt);
DataTable resutl = dv.ToTable(true, new string[]{"CompanyName","MainBusiness"});
Response.Write(resutl.Rows.Count);
|
标签:val ons add 销售人员 count type name view bsp
原文地址:http://www.cnblogs.com/artjs/p/6259227.html