protected void btnAdd_Click(object sender, EventArgs e) { string strSpParams = ""; string rtMsg = ""; string strMessage = ""; string strStartYr = txtStartYr.Text.Trim(); string strEndYr = txtEndYr.Text.Trim(); string strActive = ""; if (chkActive.Checked) { strActive = "true"; } else { strActive = "false"; } strSpParams = strStartYr + chr.ToString() + strEndYr + chr.ToString() + strActive; strSpParams += chr.ToString() + Session["UserId"].ToString() + chr.ToString() + ""; try { rtMsg = genObj.ExecuteAnySPOutput("spInsert_MstFinancialYear", strSpParams); if (rtMsg == "True") { Message.IsSuccess = true; Message.Text = "Your request has been processed successfully!"; } else if (rtMsg == "Duplicate") { Message.IsSuccess = false; Message.Text = "This Financial Year already exist!"; } genObj.BindGridViewSP(gdFinancialYr, "spSelect_MstFinancialYear_New", ""); } catch (Exception exp) { objConn.closeConnection(); Message.IsSuccess = false; Message.Text = "An Unhandled Exception Occured!"; } Message.Show = true; }