protected void gvnew_RowUpdating(object sender, GridViewUpdateEventArgs e) { int result = 0; OrderHistory order = new OrderHistory(); GridViewRow row = (GridViewRow)gvnew.Rows[e.RowIndex]; string order_id = gvnew.DataKeys[e.RowIndex].Value.ToString(); string pickupdvr = ((TextBox)row.Cells[1].Controls[0]).Text; string deliverydvr = ((TextBox)row.Cells[2].Controls[0]).Text; string order_status = ((TextBox)row.Cells[3].Controls[0]).Text; string payment_info = ((TextBox)row.Cells[4].Controls[0]).Text; string cust_id = ((TextBox)row.Cells[5].Controls[0]).Text; string total_price = ((TextBox)row.Cells[6].Controls[0]).Text; string todatetime = ((TextBox)row.Cells[7].Controls[0]).Text; string frodatetime = ((TextBox)row.Cells[8].Controls[0]).Text; result = order.Orderupdate(order_id, pickupdvr, deliverydvr, order_status, payment_info, cust_id, total_price, todatetime, frodatetime); if (result > 0) { Response.Write("<script>alert('Product updated successfully');</script>"); } else { Response.Write("<script>alert('Product NOT updated');</script>"); } gvnew.EditIndex = -1; bind(); }