Assign ado.net dataset to combobox?

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
 
C

Cor Ligthert

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
 
T

Trint Smith

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top