IListSource
IEnumerable
IDataSource
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e) { string Sno = ((TextBox)GridView1.Rows[e.RowIndex] .FindControl("txtSno")).Text; string Name = ((TextBox)GridView1.Rows[e.RowIndex] .FindControl("txtName")).Text; string Age = ((TextBox)GridView1.Rows[e.RowIndex] .FindControl("txtage")).Text; string Address = ((TextBox)GridView1.Rows[e.RowIndex].FindControl("txtaddress")).Text; SqlCommand cmd = new SqlCommand(); cmd.CommandType = CommandType.Text; cmd.CommandText = "update Details set Sno=@Sno, Name=@Name," + "Age=@Age where Sno=@Sno;" + "select Sno,Name,Age,Address from Details"; cmd.Parameters.Add("@Sno", SqlDbType.Int).Value = Sno; cmd.Parameters.Add("@Name", SqlDbType.VarChar).Value = Name; cmd.Parameters.Add("@Age", SqlDbType.VarChar).Value = Age; cmd.Parameters.Add("@Address", SqlDbType.VarChar).Value = Address; GridView1.EditIndex = -1; GridView1.DataSource = (cmd); GridView1.DataBind();
GridView1.DataSource = (cmd);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)