suhel jamadar

suhel jamadar

  • 1.8k
  • 82
  • 792

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();

Brought to you by:

Answers (4)