public void getall() { //blbooking.AgentId = Convert.ToInt32(ddlFagent.SelectedValue); //blbooking._dtStartDate = Convert.ToDateTime(txtfrom.Text); blbooking.AgentId = Convert.ToInt32(ddlFagent.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"); } DataTable dt = dlbooking.bookingDetailsforCruise(blbooking); Session["getdata"] = dt; if (dt != null && dt.Rows.Count > 0) { dgBookings.DataSource = dt; dgBookings.DataBind(); } else { dgBookings.DataSource = null; dgBookings.DataBind(); } calculatetot(dt); }