protected void btnGrid_Click(object sender, EventArgs e) { //Displaying Textboxes data into Gridview dt = new DataTable(); dt.Columns.Add("name"); dt.Columns.Add("age is"); string na = txtName.Text; int age = Convert.ToInt32(txtAge.Text); dt.Rows.Add(na, age); GridView1.DataSource = dt; GridView1.DataBind(); //DataRow dr1 = dt.NewRow(); //dr1[0] = txtName.Text; //dr1[1] = txtAge.Text; //dt.Rows.Add(dr1); //GridView1.DataSource = dt; //GridView1.DataBind(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)