我收到 DropDownList11 的错误,说“'DropDownList11' 有一个无效的 SelectedValue,因为它不存在于项目列表中。参数名称:值”。SQLDatasource 的其他下拉列表工作正常。我在编辑 DetailsView 中手动创建此下拉列表。一旦选择并单击更新,它将发送到 SQL Server。请帮忙!这里有一个代码,
<EditItemTemplate>
<asp:DropDownList ID="DropDownList11" runat="server" SelectedValue='<%# Bind("Version") %>'>
<asp:ListItem Selected="True"></asp:ListItem>
<asp:ListItem>Oracle 11g</asp:ListItem>
<asp:ListItem>Oracle 11g R2</asp:ListItem>
<asp:ListItem>Server 2008</asp:ListItem>
<asp:ListItem>Server 2008 R2</asp:ListItem>
<asp:ListItem>Server 2012</asp:ListItem>
<asp:ListItem>SQL Svr 2008 R2 SS%S</asp:ListItem>
<asp:ListItem>SQL Svr 2012 SS%S</asp:ListItem>
</asp:DropDownList>
</EditItemTemplate>