protected void gvTransferRequests_RowEditing(object sender, GridViewEditEventArgs e) { try { int SNO = Convert.ToInt32(gvTransferRequests.Rows[e.NewEditIndex].Cells[0].Text); DataRow dr = ((DataSet)ViewState["ds"]).Tables[0].Select("SNO=" + SNO)[0]; objAdmin.SNO = Convert.ToInt32(dr["SNO"].ToString()); objAdmin.UserId = Convert.ToInt32(dr["ConsumerNo"].ToString()); objAdmin.CityId = Convert.ToInt32(dr["ToCity"].ToString()); objAdmin.AgencyName = dr["ToAgencyName"].ToString(); string s = objAdmin.UpdateUserTransperRequests(); lblMsg.Text = s; ShowTransferRequests(); } catch (Exception ex) { lblMsg.Text = ex.ToString(); } }