当前位置: 动力学知识库 > 问答 > 编程问答 >

sql - Reports in VS - Data Source instance not being detected?

问题描述:

So I have made a dataset and chart in visual studio. I have then added the report viewer to the page and added the datasource instance. But when I run the page I get an error: "A data source instance has not been supplied for the data source 'DataSet1'"

Here is my code for both the sql query which is the datasource instance and the code for the reportviewer.

 <rsweb:ReportViewer ID="rptpassfails" runat="server" Font-Names="Verdana" Font-Size="8pt" ShowBackButton="False" ShowFindControls="False" ShowPageNavigationControls="False" ShowZoomControl="False" WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" Width="100%">

<LocalReport ReportPath="Reports\chart_passfails.rdlc" DisplayName="dspassfail" ReportEmbeddedResource="Qsis.Reports.chart_passfails.rdlc">

<DataSources>

<rsweb:ReportDataSource DataSourceId="sqlpassfail" Name="passfail" runat="server"/>

</DataSources>

</LocalReport>

</rsweb:ReportViewer>

<asp:SqlDataSource ID="sqlpassfail" runat="server" ConnectionString="<%$ ConnectionStrings:DefaultConnection %>"

SelectCommand="SELECT

StudentModule.StudentPassFailModule

,[Module].ModuleCode

,Course.CourseName

,Course.School

,Course.EntryYear

FROM

[Module]

INNER JOIN StudentModule

ON [Module].ModuleId = StudentModule.ModuleId

INNER JOIN Course

ON [Module].CourseId = Course.CourseId

Where [email protected] AND [email protected]">

<SelectParameters>

<asp:QueryStringParameter Name="entryyear" QueryStringField="entryyear" Type="String" />

<asp:QueryStringParameter Name="course" QueryStringField="course" Type="String" />

</SelectParameters>

</asp:SqlDataSource>

Any help on this would be greatly appreciated!

分享给朋友:
您可能感兴趣的文章:
随机阅读: