![]() |
| ||
| Dropdownlist Hi, I want to display a text, getting from database, into a DropdownList using text property. My Code:: SqlDataReader drd; But It Display an error:: 'drpcompname' has a SelectedValue which is invalid because it does not exist in the list of items. Parameter name: value Please help me. Thanks! Pankaj Singh |
| ||
| Re: Dropdownlist Welcome Pankaj18, Your source code must be surrounded with bb code tags. Read this How to use bb code tags? Error message shows that a value you are assigned to the DropDownList control is not present inside the DropDownList's items. Yes, the DropDownControl is empty. Isn't it? Here, I am using bb code tags - See, how a source looks !!! SqlDataReader drd; |
| ||
| Re: Dropdownlist Quote:
|
| ||
| Re: Dropdownlist Quote:
the above code add the items ,not display...... |
| ||
| Re: Dropdownlist Does your dropdownlist contains items? If yes then use drpcompname.SelectedValue=drd.GetValue(0).ToString(); |
| ||
| Re: Dropdownlist Quote:
drpclienttype' has a SelectedValue which is invalid because it does not exist in the list of items. Parameter name: value help me.. Pankaj Singh |
| ||
| Re: Dropdownlist First, fill the dropdownlist with values. |
| ||
| Re: Dropdownlist Thanks. But it working when dropdownlist have some values, i have another case when i have no items in dropdownlist,it have only one item 'Select One', it display same error:: 'drpcompname' has a SelectedValue which is invalid because it does not exist in the list of items. Parameter name: value Thanks! Pankaj Singh |
| ||
| Re: Dropdownlist Thanks, Please, Mark this thread as Solved if you get solution. |
| ||
| Re: Dropdownlist If dropdownlist has no items (values) then you cannot assign a value for selection. This is the fact. Do not assign value if dropdown is empty. |
| All times are GMT -4. The time now is 4:02 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC