I'm sure I'm making this more difficult than it is but I'm stumped. I want to populate a combobox with two items from a database table. The table has a name and an associated id. I want to display the name in the combobox dropdown and then use the associated id in the code. I've tried everyway I can think of to make this work but nothing seems to get me there. I created a simple object that contains the name and ID and then inserted that into the Items of the combobox, but then at run time I see the object in the dropdown intead of the name. This is logically what I want to do:
combobox1.items.add(new listitem("Jones", 123))
This is how I would do it in ASP.net code, but of course that doesn't work in VB for a windows application.
What am I missing?
Thanks,
rivers
combobox1.items.add(new listitem("Jones", 123))
This is how I would do it in ASP.net code, but of course that doesn't work in VB for a windows application.
What am I missing?
Thanks,
rivers