1. Definition
DataTable dt = new DataTable("TableName");
DataSet ds = new DataSet("SetName");
DataTable dt = ds.Tables.Add("TableName");
dt.Columns.Add("ColumnName", System.Type.GetType("System.String"));
dt.PrimaryKey = new DataColumn[] { dt.Columns["ColumnName"] };
DataSet ds = new DataSet("SetName");
DataTable dt = ds.Tables.Add("TableName");
dt.Columns.Add("ColumnName", System.Type.GetType("System.String"));
dt.PrimaryKey = new DataColumn[] { dt.Columns["ColumnName"] };
2. Add data
DataRow row = dt.NewRow();
row["ColumnName"] = "ColumnValue";
dt.Rows.Add(row);
row["ColumnName"] = "ColumnValue";
dt.Rows.Add(row);
3. TBC
在模仿中成长,在创新中成功