日期:2014-05-17 浏览次数:20600 次
DataTable dt = new DataTable();
dt.Columns.Add("Name");
dt.Columns.Add("Count", typeof(Int32));
DataRow dr1 = dt.NewRow();
dr1["Name"] = "aaa";
dr1["Count"] = 2;
dt.Rows.Add(dr1);
DataRow dr2 = dt.NewRow();
dr2["Name"] = "bbb";
dr2["Count"] = 2;
dt.Rows.Add(dr2);
DataRow dr3 = dt.NewRow();
dr3["Name"] = "ccc";
dr3["Count"] = 2;
dt.Rows.Add(dr3);
DataRow dr4 = dt.NewRow();
dr4["Name"] = "eee";
dr4["Count"] = 2;
dt.Rows.Add(dr4);