4
Answers

drphh1' has a SelectedValue which is invalid because it does

D Dasawari

D Dasawari

7y
242
1
Error :  'drphh1' has a SelectedValue which is invalid because it does not exist in the list of items. Parameter name: value
 
Database : MS Access 
Id: Microsoft Visual Studio 
Reason  : ??
please recify it as I am new to asp.net and not getting to know with it like dropdownlist1, 2 etc creating problem I think  . 

Attachment: C#CornerQues.rar

Answers (4)
0
Midhun T P

Midhun T P

NA 19.7k 281.2k 7y
Hi,
 
This error happens mainly when the value we set for dropdown is not in the list. Try below code. 
  1. if (drphh1.Items.FindByValue(rdr[5].ToString()) != null)  
  2. {  
  3.     drphh1.Text = rdr[5].ToString();  
  4. }  
 
Please go through below thread -
 
https://stackoverflow.com/questions/19770207/dropdownlist-has-a-selectedvalue-which-is-invalid-because-it-does-not-exist-in-t
Accepted
0
D Dasawari

D Dasawari

NA 135 5.7k 7y
Thanks
0
D Dasawari

D Dasawari

NA 135 5.7k 7y
Ok sir, i have removed # from file name and try to download now.
0
Midhun T P

Midhun T P

NA 19.7k 281.2k 7y
Hi,
 
Not able to download your rar file because of having # in it's name. Can u please upload it once again by renaming (remove # from name).