没有将DataRow添加到DataTable
System.Data.DataSet objSet = new DataSet();
System.Data.DataTable objTable = new DataTable("test");
objTable.Columns.Add("CodeID", typeof(string));
objTable.Columns.Add("FilterCitem ", typeof(string));
objTable.Columns.Add("FilterSqlStr", typeof(string));
System.Data.DataRow dr = objTable.NewRow();
dr[0] = "row0andcol0";
dr[1] = "row2andcol2";
dr[2] = "row3andcol3";
objTable.Rows.Add(dr);
objSet.Tables.Add(objTable);
this.DataGridMatch.DataSource = objSet.Tables["test"];
this.DataGridMatch.DataBind();
C#创建DataSet
最新推荐文章于 2022-10-11 20:34:09 发布