Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:

i have a combo box
its value member is "product_id"
its display member is "product_name"
i want to insert its value member in to sql table numeric column
example
comb0box display member is Milk Pack 1 Ltr Pack
and value member is 30
i want to insert 30(Value member)in sql table not its display member
how is it possible kindly help me
Thanx in Advance
Posted
Comments
[no name] 23-Oct-14 20:08pm    
You're not making any sense regarding your explanation. Can you explain what the name of your combobox control is? The value is not totally important right now.

Just know that you can't insert a string value as such: ' Milk 1 Ltr ' to a numeric SQL field, as the value would have to be of type integer: ' 1 ' (Numeric only).

Please also show what you have tried?
Sinisa Hajnal 24-Oct-14 2:44am    
I think he says his value member is an integer. But the question remains, what have you tried? Where is your code that tries to insert the value and fails?

 
Share this answer
 
To be honest your question is not very clear. It depends on what event you would want to trigger this to save in the database.

On the selected event of comb0box can return the literal like this

Dim str = comb0box.ValueMember.
 
Share this answer
 

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