combobox - Key & Value pair problem
Hi !!
I do windows based database programming using only C# as the front end.
Often i have to populate the comboboxes with data from tables for choosing an item or vendor etc from the list.
The problem is that unlike in asp.net, the C# does not allow me to insert key value pairs in to the comboboxes. As in case of database programming we generally display the descriptions while using the ID internally (like: showing a list of products for selection in the combobox while using the selected product's ID to insert a record in the sales table).
Currently i am using a pair of comboboxes , one to fill the product names and other to fill the product ids. In order to get the ID i use the selected index property of combobox1 to retrieve the ID from combo box 2. But this consumes a lot of resources and is a bit lengthy too. The same thing C# supports it in ASP.Net but not in Windows Programming. Why ? Is there any other alternative ?
Plz Help & Thanks.
dev(1);
__________________
dev(1);
|