<asp:SqlDataSource ID="workHourListSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:PlaningSystemConnectionString %>"
SelectCommand="SELECT *
FROM Date AS t1 FULL OUTER JOIN (SELECT * FROM WorkHoursEntry WHERE (WorkerID LIKE @WorkerID)) AS t2 ON t1.PKDate = t2.WorkDay
LEFT OUTER JOIN Worker AS t3 ON t2.WorkerID = t3.WorkerID
LEFT OUTER JOIN (SELECT * FROM Project WHERE ProjectID IN(@Project)) AS t4 ON t2.ProjectID = t4.ProjectID"
FilterExpression="YearMonth IN({0})">
<FilterParameters>
<asp:ControlParameter ControlID="yearMonthFilterLabel" Name="YearMonth"
PropertyName="Text" Type="String" />
</FilterParameters>
<SelectParameters>
<asp:ControlParameter ControlID="WorkerIDLabel" Name="WorkerID"
PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="projectFilterLabel" Name="Project"
PropertyName="Text" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
问候,我对 @Project ControlParameter 有疑问,问题是我不知道如何传递多个值,并且 FilterParameters 方法无法按我的意愿工作。有没有办法传递几个变量?(不使用 c#)。
projectFilterLabel.Text = 'aaa, bbb, ccc';
基本上我想要做的是从日期表中选择所有值并将它们与项目表中的一些值连接起来并输出到 DataList。
任何帮助表示赞赏,我刚开始学习 asp.net
谢谢。