I got error for DropDownList11 that say “‘DropDownList11’ has a SelectedValue which is invalid because it does not exist in the list of items.
Parameter name: value”. The other dropdownlists with SQLDatasource work fine. I manually create this dropdownlist in edit DetailsView. Once it selected and click update, it will send it to SQL Server. Please help! Here a Code,
<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>
No value that is already in dropdown (Oracle 11g, Oracle 11g R2,…) can be matched with value that you are binding (SelectedValue='<%# Bind(“Version”) %>’).
Remove binding from dropdown and add asp label. Bind value to it and you will see what value are you trying to bind. Here is sample code for label: