protected void btn_Update_Click(object sender, EventArgs e) { DataTable dt = new DataTable(); try { if (Validate()) { DateTime Effectivedate = DateTime.Parse(txt_Date.Text.Trim(), provider, System.Globalization.DateTimeStyles.NoCurrentDateDefault).Date; dt = objDist.UpdateRegBAL(ddl_Ins_code.SelectedValue.ToString(), ViewState["AnimalTypeCode"].ToString(), txtregfee.Text, Session["UsrName"].ToString(), Effectivedate, "U", ConnKey); if (dt.Rows.Count > 0) { objCommon.ShowAlertMessage(dt.Rows[0][0].ToString()); txt_Date.Text = ""; txtregfee.Text = ""; txtregfee.Enabled = true; txt_Date.Enabled = true; btn_Save.Visible = true; btn_Update.Visible = false; ddlAnimal.Enabled = true; BindAnimal(); Viewdata(); } } } catch (Exception ex) { ExceptionLogging.SendExcepToDB(ex, Session["UsrName"].ToString(), Request.ServerVariables["REMOTE_ADDR"].ToString()); Response.Redirect("~/Error.aspx"); } }