Link to home
Start Free TrialLog in
Avatar of asimahmed073100
asimahmed073100

asked on

ItemData of Combobox in .Net

Hi, My questions is, I have Province table with Province Name and Province Code. In VB 6, we had this property ItemData where we can store related value and run query based on that. But in VB.Net, we don't have this kind of property. Can anyone help me out, how can i do this in .Net?

Thanks.
Avatar of Arthur_Wood
Arthur_Wood
Flag of United States of America image

In .Net, what is actually held in a ComboBox is an Object, not a simple string.  What is displayed in the ComboBox is defined by the Object's .ToString() .

That being the case, if you define the class correctly, you can have almost any data available when you select an Item from the ComboBox.

Yes, that will require that you re-write the part of the code that both stores items in the ComnboBox, and the code that uses the Selected Item.  But the increase in capability will be well worth the necessary re-coding effort.

AW
Avatar of asimahmed073100
asimahmed073100

ASKER

Thanks Arthur, but i am just wondering how would i save both items in combobox as i don't want users to see the ProvinceID. One more thing came up in my mind is about DataSet. Could you help me out, where can i get much and detailed information about the DataSet.

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Arthur_Wood
Arthur_Wood
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
asimahmed:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.