DataTable table = new DataTable();
table.Columns.Add("col" + 1,System.Type.GetType("System.String") );
table.Columns.Add("col" + 2, System.Type.GetType("System.Int16"));
DataRow drRow1 = table.NewRow();
drRow1["col" + 1] = "aaa";
drRow1["col" + 2] = 1;
table.Rows.Add(drRow1);
就是创建一个DataTable,两列,col1,col2,有一个条数据为:aaa,1,请问这样创建的方式正确吗?
datarow
最新推荐文章于 2022-11-15 17:12:37 发布