Typed Datasets with ComboBox

  • Thread starter Thread starter gordigor
  • Start date Start date
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.
 
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.
 
Back
Top