Click here to Skip to main content
15,919,500 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am facing a simple problem. I have values in a combo box. When user selects 1 and press certain button. The program must find a value against the user selected value in combo box from a database and update a table.

The problem is that values in combo box are not unique. So, how i can find its unique value form a data base using the combo box value?

thanks
Posted
Comments
Pete O'Hanlon 17-May-12 12:05pm    
Is it that the Text is not unique, or that the values themselves aren't unique?
Waleed_Hassan 17-May-12 12:20pm    
The value them self are not unique. For Example.

Table 1
Col 1 P.K.
Col 2 some values
Col 3 Some values

I am loading the col 2 values in combo box. Now i try to find the col 1 values using col 2.
Jim Jos 18-May-12 4:09am    
If you don't have unique values in col2 you need to bring along col1 values also in to the comboboxitem (concat with col2 and put it in the value).. Then from the selected item spearate the col1 value and use it to fetch data

1 solution

not clear..can you eloborate.

The program must find a value against the user selected value in combo box from a database and update a table.
-->even if values in combo box are not unique,it will find correct value from database.

(not clear)
 
Share this answer
 
Comments
Waleed_Hassan 18-May-12 7:23am    
I have updated the combo box with values form col 2 as given in the example.
So, when user selects from the combo box and press the update button. i want the col 1 values to be fetched from table and update in another table.

Example.
Table 1
Col 1 P.K.
Col 2 some values
Col 3 Some values

I am loading the col 2 values in combo box. Now i try to find the col 1 values using col 2.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900