Assign ado.net dataset to combobox?

  • Thread starter Thread starter trint
  • Start date Start date
T

trint

I have an app that I have been using this code to fill a datagrid:

DataSet ds = new DataSet("Recordset");
OleDbDataAdapter da = new OleDbDataAdapter();

// Call data adapter's Fill method to fill data from ADO
// Recordset to ADO.NET dataset
da.Fill(ds, rs, "tblTravelEventType");

// Assign data set to grid control
DropDownList1.DataSource = ds;
DropDownList1.DataMember = "tblTravelEventType";

But now I want to assign just one of the fields to the combobox1..
How can I do that? Can you give me an example?

Thanks,
Trint
 
Trint,

The displaymember holds the datatable column in the box
The valuemember the column from the datatable that you want to use.

I hope this helps,

Cor
 
Cor,
Thanks...I don't know if you remember, but you helped me a couple of
years ago on a vb.net project question or two (maybe three).
Trint

.Net programmer
(e-mail address removed)
 
Back
Top