-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();