Click here to Skip to main content
15,906,329 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Everyone,
I had a textbox for saving address but now its being replaced with dropdownlist in asp.net.
While binding the previous record with the dropdownlist.It gives the following error:-
SQL
'column1' has a SelectedValue which is invalid because it does not exist in the list of items.
Parameter name: value


thats the markup
ASP.NET
<td style="text-align: left">
                        <asp:DropDownList ID="column1" AutoPostBack="true" runat="server" Style="width: 250px"
                            OnSelectedIndexChanged="column1_SelectedIndexChanged" OnDataBound="column1_DataBound">
                        </asp:DropDownList>
                    </td>

How an it be resolved now?
Posted
Updated 17-Feb-14 21:53pm
v5
Comments
Ahmed Bensaid 17-Feb-14 6:00am    
Can we see your code ?
Sumit Bhargav 17-Feb-14 6:40am    
column1.DataSource = Service.Countries();
column1.DataMember = "country";
column1.DataBind();
Ahmed Bensaid 17-Feb-14 8:17am    
Edit your question and add your page markup and code-behind ...
Sumit Bhargav 18-Feb-14 3:51am    
the error is coming on column1.databind();
The14thNoah 18-Feb-14 0:59am    
can you show us your code?
and the line you get the error?

1 solution

where is the value field on your code. try and write datatext filed and data value field on your code.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900