Monday, February 8, 2010

ASP.NET DropdownList Control and Database?

I want to insert a new item in the items table, i shud first select the category from a dropdownbox under which that item will be.





Every category name has its unique ID.





How do i insert the CatID into the ITEMS table,on selecting the category name from the DropDownBox?ASP.NET DropdownList Control and Database?
Get the value selected in the dropdownbox


Dim category as string


categoryID= DropDownList.selectedValue





then use it in your SQL statement





sql=';INSERT INTO items


VALUES (categoryID, value2, value3,...)';

No comments:

Post a Comment