|
[x]
Posted via EE Mobile
|
|
| Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
|
|
|
|
Asked by amukta in .NET Framework 2.x, Programming for ASP.NET, C# Programming Language
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!
20091021-EE-VQP-81 - Hierarchy / EE_QW_3_20080625