标签:des style c class blog code
DataTable tblDatas = new DataTable("Datas"); tblDatas.Columns.Add("ID", Type.GetType("System.Int32")); tblDatas.Columns[0].AutoIncrement = true; tblDatas.Columns[0].AutoIncrementSeed = 1; tblDatas.Columns[0].AutoIncrementStep = 1;//自增列 tblDatas.Columns.Add("Product", Type.GetType("System.String")); tblDatas.Columns.Add("Version", Type.GetType("System.String")); tblDatas.Columns.Add("Description", Type.GetType("System.String")); DataRow row; for (int i = 0; i <= 3; i++) { row = tblDatas.NewRow(); row["Product"] = "789"; row["Version"] = "Item "; row["Description"] = "567"; tblDatas.Rows.Add(row); } foreach (DataRow dr in tblDatas.Rows) { Response.Write(dr["Version"].ToString() + "<br/>"); }
datatable动态添加,及填充数据,布布扣,bubuko.com
标签:des style c class blog code
原文地址:http://www.cnblogs.com/sishahu/p/3746282.html