Microsoft
Software
Hardware
Network
Question : Question about ASP.NET Drop Down List Control
I’m using
Microsoft Visual Web Developer 2010
and
VB
. I created a database with a 2-character State field,
i.e
., OH for Ohio. I also have a web form on which I placed a drop down list control. I primed the drop down list control’s Items property with the names of the 50 states using the full name (
i.e.,
“Ohio”) as the Text property of the drop down list’s collection item and the corresponding 2-letter abbreviation (
i.e
., “OH”) as the Value property. When I view the form in a browser the drop down list looks fine and you can select a state from the list of 50, but as soon as I try to bind the database field to the drop-down list it doesn’t work correctly and I don’t see the collection of Items any more.
My goal is to make it so that a user can pick from the drop down list of 50 states and, when they submit the form, the database would be populated with the 2-character state abbreviation. I’ve tried setting the various properties in every way I can think of without success. It seems that when I set the drop-down list’s DataTextField (or DataValueField) property to the State field of my database, the drop down list populates from the database instead of my collection of items. How can I set the drop down list so that the user can choose from the collection of 50 states and have the corresponding abbreviation posted to the database?
Answer : Question about ASP.NET Drop Down List Control
to get the value then just use
string abbreviation = DropDownList1.SelectedValu
e;
Random Solutions
How to Determine what SQL Databases are Installed & Running?
Still having issues pinging from one subnet to another through ASA 5510
Exchange 2010 and /exchange error
Win XP freezes after installing my Asus P6X58D mobo
Google Analytics
NETGEAR FVS336G
BGINFO via GPO server 2008, error loading bgi file even though its all loaded correctly
How come when I do a copy run start, my config is always gone after a reload???
Outlook 2007/Mozilla Thunderbird Cannot Connect to Email Server
Exchange 2010 Delegate Distribution List Permissions