用法
table = new DataTable();
添加列:
table.Columns.Add(new DataColumn() { ColumnName = "ID", DataType = typeof(int) });
DataRow row = new DataRow();
row["ID"] = i;
table.Rows.Add(row);
不支持 row[0],即不能按索引指定列只能用列名.
用法
table = new DataTable();
添加列:
table.Columns.Add(new DataColumn() { ColumnName = "ID", DataType = typeof(int) });
DataRow row = new DataRow();
row["ID"] = i;
table.Rows.Add(row);
不支持 row[0],即不能按索引指定列只能用列名.
转载于:https://www.cnblogs.com/lmarsy/archive/2010/02/05/1664188.html