C#:
DateTime dtStartDate = DtStartingDate.Value;
DateTime dtEndDate = DtEndingDate.Value;
ReportParameter[] newparams = new ReportParameter[2];
newparams[0] = new ReportParameter("StartDate", dtStartDate.ToString(), false);
newparams[1] = new ReportParameter("EndDate", dtEndDate.ToString(), false);
this.SampleCountReportViewer.LocalReport.SetParameters(newparams); // <-- this line throws the error. Hovering over dtStartDate and dtEndDate shows the correct dates as taken from the form.
this.SampleCountReportViewer.RefreshReport();
Thank you.