Hi,
Have been writing in VB .net for a few years now but this is the first time I have attempted to use data binding and I am having a problem which I just can't understand...
I am creating a dataset and populating it using a data adapter, it all seems to work fine up until this point, I then set the datasource for my combobox to the dataset but when I set the ValueMember i get the following error:
what's even stranger is that although I set the displayMember property and there is no error the value is not actually set but although an error is thrown when setting the valueMember, the displayMember property actually takes on the value i have assigned to the valueMember property???
Here is my code:
This is extremley confusing and i hope someone will be able to point me in the right direction
Regards,
Chris V
Have been writing in VB .net for a few years now but this is the first time I have attempted to use data binding and I am having a problem which I just can't understand...
I am creating a dataset and populating it using a data adapter, it all seems to work fine up until this point, I then set the datasource for my combobox to the dataset but when I set the ValueMember i get the following error:
VB.NET:
Cannot bind to the new display member. Parameter name: newDisplayMember
what's even stranger is that although I set the displayMember property and there is no error the value is not actually set but although an error is thrown when setting the valueMember, the displayMember property actually takes on the value i have assigned to the valueMember property???
Here is my code:
VB.NET:
DAservices = New SqlClient.SqlDataAdapter(SQLservices, conn)
DSservices = New DataSet()
DAservices.Fill(DSservices)
CMBservice.DataSource = DSservices
CMBservice.DisplayMember = "description"
CMBservice.ValueMember = "serviceid"
CMBservice.Refresh()
This is extremley confusing and i hope someone will be able to point me in the right direction
Regards,
Chris V