How to get data from a SQL server and put it into a comobox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

I 'm trying to do some pretty simple stuff but can't get it to work.
I want to get some data from a database (on sql server) and show a column
from the table in a combobox. I can copy the data from the database (an
actual table) into a DataTable but at this point I'm stuck. The DataTable
consists out of 2 colums (Unique key, string). How can I get Data from the
DataTable in string format.

Regards
Stijn
 
Stjin,

You should be able to set the DataSource property of the ComboBox to the
table. Then, you would want to set the DisplayMember to the name of the
column in the table which has the value you want to display.

Hope this helps.
 
Back
Top