Sami-L Sami-L - 1 year ago 169
ASP.NET (C#) Question

rdlc report - ‘A data source instance has not been supplied for the data source’ error

In my ASP.Net Web pages project I have created a new Web page and I dragged a script manager control onto it, then I created a new rdlc report using the wizard and configured the dataset (to show 3 fields of Products table: ProductName, quatityPerUnit, Price) which begun to retrieve data.

At the following step, I inserted a new Reportviewer and bound it to the previously created report, then again I verified that the data is retrieved by opening the dataset1.xsd file and clicking on preview data.

and this is my web page body code:

<form id="form1" runat="server">

<asp:ScriptManager ID="ScriptManager1" runat="server">
<rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" Font-Size="8pt" WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt">
<LocalReport ReportPath="Reports\MyRdlcReport.rdlc">
<rsweb:ReportDataSource DataSourceId="ObjectDataSource1" Name="dsProducts" />
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetData" TypeName="WebApplication1.dsProductsTableAdapters.ProductsTableAdapter">


But When I run the project, I get the next error: A data source instance has not been supplied for the data source ‘dataSource1’, I have tried to find a similar case on the net but succeeded to find nothing, any help please ?

Answer Source

Finally I found the cause, it was a non corresponding Tablix data set name property. I had to rename it from dataSet1 to dsProducts.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download