Typed Datasets with ComboBox

G

gordigor

I am sure this is going to be obvious, but I can't see it. I have a
strong typed dataset called "Clients" with two columns: ClientName ,
ClientCode. I want to attach a ComboBox to this dataset. Here is the
code:

Dim TAListOfClients As New ClientsTableAdapters.ClientsTableAdapter

Dim ListOfClients As New Clients.ClientsDataTable
TAListOfClients.Fill(ListOfClients)

cboClientList.DataSource = ListOfClients

When I set the combobox to an untyped version it works:

cboClientList.DisplayMember = "ClientName"

When I set the combobox to the Typed version it displays
System.Data.DataRowView :

cboClientList.DisplayMember = ListOfClients(0).ClientName

I want to use the strongly typed version. Can anyone see what I am
doing wrong.

Thanks.
 
R

RobinS

Didn't you post this exact question in another newsgroup
a day or so ago? You can't bind the DisplayMember
to ListOfClients(0).ClientName. You might be able to
find it to ListOfClients.ClientName, but what's with the (0)?

Robin S.
 

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