inserting values into a DB from a dropdownlist

jad

New Member
I'm having an odd problem. I just finished an asp.net book and I'm trying out some of my new ideas, I'm a 3 yr. ASP veteran but new to asp.net and C#.<BR><BR>I'm trying to insert an integer value into a sql server 2K database from a web form DropDownList value. The value is set to an integer and the text value, what you see in the dropdown, is a string.<BR><BR>theRow["BillTypeCat"] = BillType.SelectedItem;<BR><BR>I get a datatype error when trying to insert the int in the value=http://aspmessageboard.com/archive/index.php/"" attribute into the database.<BR><BR>Is it trying to insert the string that's visible in the dropdown?How do I direct it to insert the value (which is an int) of the list item and not the text?
 
Back
Top