HI!
I have some dropdown lists on the page.Code in c#/asp.net 2.0
I need to fill them with the values from the database.
Sometimes when there is no correct data in the table. my code blows up
as of now, I'm doing it this way
if(!String.IsNullorEmpty(d
reader["fi
eld"].toSt
ring()))//
I'm using the right case and syntax in the code. ddl.selectedvalue=dreader[
"field"].T
oString+""
;//dreader
is the datareader
else
ddl.selectedindex=0;
The "0"th item has a value <--Please Select--> for some and "" for some.
How do I read text into dropdownlist...this is another question in addition to the above question.
Any logic/code would be greatly appreciated.
Thanks a lot in advance!