ComboBox and collection

FatEric

New member
Joined
May 5, 2008
Messages
2
Programming Experience
Beginner
Hi all,

In my program I use some combobox's. If have a button "search" that executes a sql statement that gets data from an AS400 system database. The values I selected with the sql statement show up in the combobox's (so that works fine). But sometimes there's a wrong value in my database (it's one with 2000 records and 40 fields...).
Now I also have a save button. I want to check it the value that my combobox shows is in the collection of the combobox (where I have put all data that can be used). When I click the save button I execute an update sql statement with the value of the combobox in it. But this sometimes fails because there is a wrong data in the combobox.
My question is how to check if the combobox.value() is in the collection list for that combobox?

Any help is welcome.

Many thanks in advance.

FatEric
 
You dont bother. Instead you bind the combo to a DataTable containing all the values you want and set its DropDownMode to DropDownList
 
Ok thanks,

I have asked the people to clean up the database (I was something that had to been done anyway) and but the combobox on a DropDownList mode (did not know that function). So than there can be no wrong data in the database anymore.

Thanks very much,

FatEric
 

Latest posts

Back
Top