Ninds

Ninds

  • NA
  • 1
  • 2.5k

how to display 2 values from database to the combobox control e.g. "1-abc"

May 5 2011 2:20 AM


hi ,
i m new to c#;
In my desktop application i want to show combobox as follows:

1-abc
2-def
3-ghi

etc.

my database table structure is :
 id   description
 1     abc
 2     def
 3     ghi

In short i want something like
 combo1.displaymember="id-description";
and
combo1.valuemember="id";

please suggest me possible workaround for this


Answers (4)