当值设置为 null 时,我有一个包含各种项目的下拉框我想使用控制参数选择多个项目来填充数据源,如下所示。这个选择命令不起作用,谁能帮我看看我做错了什么?编辑下面的代码现在是正确的和功能.....
<asp:DropDownList ID="FilterList1" runat="server">
<asp:ListItem Selected="True" Value=" ">Produce</asp:ListItem>
<asp:ListItem>Fruits</asp:ListItem>
<asp:ListItem>Vegetables</asp:ListItem>
<asp:ListItem>Milk</asp:ListItem>
<asp:ListItem>Pop</asp:ListItem>
</asp:DropDownList>
<asp:AccessDataSource ID="AccessDataSource1" runat="server"
DataFile="~/AFOLDER/db1.mdb"
SelectCommand="SELECT * FROM [Table1] WHERE IIF( (@Food1 =' '), [Food] In ('Fruit','Vegetable'), (Food =@Food1) )">
<SelectParameters>
<asp:ControlParameter ControlID="FilterList1" Name="Food1"
PropertyName="SelectedValue" Type="String" />
</SelectParameters>
</asp:AccessDataSource>