I have the following issue appearing in a report, the data for which is dynamically loaded using C# in a win-forms .net 4 application.
Cannot create a DataReader for dataset "projectDS_ObservationImages"
The source that loads the report with data :
this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("ProjectDS_Site", this._dsProjectData.Tables["Site"]));
this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("ProjectDS_Client", this._dsProjectData.Tables["Client"]));
this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("ProjectDS_Head", this.getRangedHeadersCopy(this._htExcludeHeaders)));
this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("ProjectDS_Obs", this.getRangedObservationsCopy(this._htExcludeObservations)));
this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("ProjectDS_Images", dtProjectImages));
this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("ProjectDS_PMPL", this._dtPerMeterPerLineHeaders));
this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("ProjectDS_ObservationImages", this._dtObervsationImages));
It is the last DataSource being added to the report that causes the issue.
Each DataSource is in fact a DataTable. All are members of a DataSet in this project (or have cloned a schema), which is used as the only DataSet in the report. The names of the passed DataTables and the names of the Data Sets within the report, match 100%.
All other data passed to the report work, there is nothing special about this data source as opposed to the other 6 successfully passed.
No errors are provided in output when the report is processed.
What could cause the DataReader to fail?
Thanks for any input.
UPDATE ------------------------------------------------------------------------
Renaming does not work, rebuilding the DataTable by hand does not work, Creating and including a new DataTable with the same data does not work.
Copy and pasting the report elements into a sub report, and including the sub report on the main report, everything works fine, same data building code, same data, and same report layout.
Could the rdlc file be corrupt?