-2
我想通过网格视图中的任何注册表单绑定数据。 但是,他们是没有数据库。我们没有任何数据库,所以没有数据被存储来检索。我怎样才能做到这一点..???在GridView中绑定数据没有输入数据库
我想通过网格视图中的任何注册表单绑定数据。 但是,他们是没有数据库。我们没有任何数据库,所以没有数据被存储来检索。我怎样才能做到这一点..???在GridView中绑定数据没有输入数据库
//declare a datatable
DataTable dt = new DataTable();
dt.Columns.Add(new DataColumn("id", typeof(int)));
dt.Columns.Add(new DataColumn("Name", typeof(string)));
//fill it with data
DataRow dr = dt.NewRow();
dr["id"] = 1;
dr["Name"] = "Name"
dt.Rows.Add(dr);
//set the datasource and bind the grid view
GridView1.DataSource = dt;
GridView1.DataBind();