suhel jamadar

suhel jamadar

  • NA
  • 133
  • 12.3k

RDLC report filter by date to date showing no data

May 19 2020 4:29 PM
Amit Sir Changed but still same
SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\Del\Documents\Data.mdf;Integrated Security=True;Connect Timeout=30");
con.Open();
string query = string.Format("SELECT * FROM Sale WHERE Date >= '{0}' AND Date<= '{1}'", dateTimePicker1.Value.ToString("yyyy-MM-dd"), dateTimePicker2.Value.ToString("yyyy-MM-dd"));
cmd = new SqlCommand(query,con);
sda = new SqlDataAdapter(cmd);
sda.Fill(dt);
ReportDataSource rdsd = new ReportDataSource("DataSet1", dt);
reportViewer1.LocalReport.ReportPath = @"E:\poulatry\WindowsFormsApp2\SalesR.rdlc";
reportViewer1.LocalReport.DataSources.Clear();
reportViewer1.LocalReport.DataSources.Add(rdsd);
reportViewer1.RefreshReport();
con.Close();

Answers (4)