public static DsReports.SalesAmountDetailsDataTable GetDailySalesReport(DateTime d1, DateTime d2, bool bydate = false, bool useconstr = false, string newconstr = "p") { var ta = new SalesAmountDetailsTableAdapter { Connection = { ConnectionString = useconstr ? newconstr:_constr } }; var ds = new DsReports().SalesAmountDetails; if (!bydate) { ta.Fill(ds); } else { ta.FillByDate(ds, d1, d2); } return ds; }