protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
GridViewRow row = (GridViewRow)GridView1.Rows[e.RowIndex];
TextBox bid = (TextBox)row.Cells[7].FindControl("txtbid");
TextBox bookname = (TextBox)row.Cells[0].FindControl("txtbname");
TextBox author = (TextBox)row.Cells[1].FindControl("txtau");
TextBox category = (TextBox)row.Cells[2].FindControl("txtcate");
TextBox publisher = (TextBox)row.Cells[3].FindControl("txtpub");
TextBox quantity = (TextBox)row.Cells[4].FindControl("txtquan");
string qry1 = "Update tbl_addbook SET Book_name='" + bookname.Text + "',Author='" + author.Text + "',Category='" + author.Text + "',Publisher='" + publisher.Text + "',Quantity='" + quantity.Text + "' where bid='"+ bid.Text +"' ";
var cmd = Cmd(qry1);
cmd.ExecuteNonQuery();
bind();
}
William Mary