public void getall() { blbooking.AgentId = Convert.ToInt32(ddlAgent.SelectedValue); blbooking.accomId = Convert.ToInt32(ddlaccom.SelectedValue); if (txtfrom.Text != "") { blbooking._dtStartDate = DateTime.Parse(txtfrom.Text); } else { blbooking._dtStartDate = DateTime.Parse("1990/01/01"); } if (txtTo.Text != "") { blbooking._dtEndDate = DateTime.Parse(txtTo.Text); } else { blbooking._dtEndDate = DateTime.Parse("1990/01/01"); } if (txtofrom.Text != "") { blbooking._dtPaymentFDate = DateTime.Parse(txtofrom.Text); } else { blbooking._dtPaymentFDate = DateTime.Parse("1990/01/01"); } if (txtoto.Text != "") { blbooking._dtPaymentTDate = DateTime.Parse(txtoto.Text); } else { blbooking._dtPaymentTDate = DateTime.Parse("1990/01/01"); } DataTable dt = dlbooking.getPaymentRegister(blbooking); Session["getdata"] = dt; if (dt != null && dt.Rows.Count > 0) { dgBookings.DataSource = dt; dgBookings.DataBind(); } else { dgBookings.DataSource = null; dgBookings.DataBind(); } calculatetot(dt); }