0
SQLステートメントで3番目のSelectParameterが認識されない問題[UsersDataTbl.UID] NOT IN (SELECT UID FROM [EnrollmentsTbl] WHERE ClassName = ?) AND Completed = True
@ClassName
を使用しましたが、同じエラーが発生しました:「1つまたは複数の必須パラメータに値が指定されていません。SelectParameterは使用できませんか?または@
? 「実際のクラス名」では、結果は必要に応じて変わります。
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True"
DataSourceID="AccessDataSource2" DataTextField="ClassName" DataValueField="ClassName">
</asp:DropDownList>
<asp:DropDownList ID="DropDownList3" runat="server"
DataSourceID="AccessDataSource4" DataTextField="Battallion"
DataValueField="Battallion" AutoPostBack="True">
</asp:DropDownList>
<asp:DropDownList ID="DropDownList4" runat="server"
DataSourceID="AccessDataSource5" DataTextField="Shift"
DataValueField="Shift" AutoPostBack="True">
</asp:DropDownList>
<asp:AccessDataSource ID="AccessDataSource1" runat="server"
DataFile="<%$ ConnectionStrings:AccessSubSiteString %>"
SelectCommand="SELECT [UsersDataTbl.StudentID], [UsersDataTbl.UserName],
[UsersDataTbl.LastName], [UsersDataTbl.FirstName], [UsersDataTbl.Affiliation], [UsersDataCareerTbl.Battallion], [UsersDataCareerTbl.Shift], [UsersDataTbl.UID], [ALSProviders.ALS]
FROM ([UsersDataTbl] INNER JOIN [UsersDataCareerTbl] ON (UsersDataTbl.UID = UsersDataCareerTbl.UID)) LEFT JOIN [ALSProviders] ON (UsersDataTbl.UID = ALSProviders.UID)
WHERE [UsersDataTbl.Career] = True AND [UsersDataTbl.Active] = True AND (UsersDataCareerTbl.Battallion = ?) AND (UsersDataCareerTbl.Shift = ?)
AND ([UsersDataTbl.UID] NOT IN (SELECT UID FROM [EnrollmentsTbl] WHERE ClassName = ?) AND Completed = True)
ORDER BY [UsersDataTbl.LastName]">
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList3" Name="Battallion" PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="DropDownList4" Name="Shift" PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="DropDownList1" Name="ClassName" PropertyName="SelectedValue" Type="String" />
</SelectParameters>
</asp:AccessDataSource>
ID = "DropDownList1"のオブジェクトはありますか? – Hogan
はい、ddlにクラス名が入力されています。 – BarclayVision
デフォルトの選択値はありますか? – Hogan