G
Guest
Hi,
I have the following code to set the DataSource of a ComboBox to a certain
table in an untyped DataSet, and I also want to set the DisplayMamaber of the
ComboBox to a certain column:
cmbID.DataSource = Me.Ds.Tables("Groups")
Dim str As String = Me.Ds.Tables("Groups").Columns("CustomerID").ColumnName
Me.cmbCustomerID.DisplayMember = str
Problem is, I have stepped through this code, and str is assigned the value
"CustomerID". I then step over the line where str is assigned as the
DisplayMember. However, the value of DisplayMember remains at "". The
ComboBox is populated with the appropriate number of items, but each simply
says "System.Data.DataRowView".
Any ideas? The code was fine, no changes were made, it just suddenly
doesn't like it. I then changed some code in another class, ran it, and the
ComboBox populated fine. I Ran it again, broken again. Most baffling.
I have the following code to set the DataSource of a ComboBox to a certain
table in an untyped DataSet, and I also want to set the DisplayMamaber of the
ComboBox to a certain column:
cmbID.DataSource = Me.Ds.Tables("Groups")
Dim str As String = Me.Ds.Tables("Groups").Columns("CustomerID").ColumnName
Me.cmbCustomerID.DisplayMember = str
Problem is, I have stepped through this code, and str is assigned the value
"CustomerID". I then step over the line where str is assigned as the
DisplayMember. However, the value of DisplayMember remains at "". The
ComboBox is populated with the appropriate number of items, but each simply
says "System.Data.DataRowView".
Any ideas? The code was fine, no changes were made, it just suddenly
doesn't like it. I then changed some code in another class, ran it, and the
ComboBox populated fine. I Ran it again, broken again. Most baffling.