private void BindGrid() { string id = string.Format("Id: {0} Uri: {1}", Guid.NewGuid(), HttpContext.Current.Request.Url); using (Utils utility = new Utils()) { utility.MethodStart(id, System.Reflection.MethodBase.GetCurrentMethod()); } _reportBO = new Bill_Sys_ReportBO(); int count = 0; objAL = new ArrayList(); DataSet ds = new DataSet(); try { objAL.Add(txtCompanyID.Text); objAL.Add(extddlBillStatus.Text); objAL.Add(extddlSpeciality.Text); objAL.Add(txtFromDate.Text); objAL.Add(txtToDate.Text); //objAL.Add(ddlUserList.SelectedValue.ToString()); objAL.Add(extddlUser.Text); //send location id to function getBillReportSpeciality() //objAL.Add(extddlLocation.Text); objAL.Add(txtFromServiceDate.Text); objAL.Add(txtToServiceDate.Text); if (chkVerificationsent.Checked) { objAL.Add("VS"); count++; } if (chkVerificationreceived.Checked) { objAL.Add("VR"); count++; } if (chkdenail.Checked) { objAL.Add("DEN"); count++; } if (chkPaidfull.Checked) { objAL.Add("FBP"); count++; } // DataSet ds = new DataSet(); if (count == 1) { ds = _reportBO.getBillReportSpecialityForTestSelect(objAL, "SP_GET_BILL_REPORT_SPECIALITY_FOR_TEST_SELECT"); } else if (count == 4) { ds = _reportBO.getBillReportSpecialitySelect(objAL, "SP_GET_BILL_REPORT_SPECIALITY_FOR_TEST_ALL");// } else if (count == 3) { ds = _reportBO.getBillReportSpecialityForTestThree(objAL); } else if (count == 2) { ds = _reportBO.getBillReportSpecialityForTestTwo(objAL); } else { ds = _reportBO.getBillReportSpecialityForTest(objAL); } grdAllReports.DataSource = ds.Tables[0]; grdAllReports.DataBind(); Session["sz_From_Date"] = txtFromDate.Text; Session["sz_To_Date"] = txtToDate.Text; Session["sz_User"] = extddlUser.Text; Session["sz_From_Service_Date"] = txtFromServiceDate.Text; Session["sz_To_Service_Date"] = txtToServiceDate.Text; Decimal toatal = 0; foreach (DataGridItem dg in grdAllReports.Items) { if (dg.Cells[4].Text != " ") { toatal = toatal + Convert.ToDecimal(dg.Cells[4].Text); } } lblTotal.Text = toatal.ToString(); } catch (Exception ex) { Elmah.ErrorSignal.FromCurrentContext().Raise(ex); using (Utils utility = new Utils()) { utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod()); } string str2 = "Error Request=" + id + ".Please share with Technical support."; base.Response.Redirect("Bill_Sys_ErrorPage.aspx?ErrMsg=" + str2); } //Method End using (Utils utility = new Utils()) { utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod()); } }