Hi,
I have 2 listboxes on a windows form (lstStatements & lstChoices). I databind the first list from a table dataset and then when I change the selection in this list i databind the second list from a second table in the dataset which is filtered by the selection in the first list. My problem is that as soon as the selection is made in the first list, the items in that list no longer read as they should but each line changes to "System.Data.DataRowView". Here's the code....
It seems to work fine until i get to the line...
Any help here would be greatly appreciated.
Thanks
I have 2 listboxes on a windows form (lstStatements & lstChoices). I databind the first list from a table dataset and then when I change the selection in this list i databind the second list from a second table in the dataset which is filtered by the selection in the first list. My problem is that as soon as the selection is made in the first list, the items in that list no longer read as they should but each line changes to "System.Data.DataRowView". Here's the code....
Code:
Private Sub lstStatements_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstStatements.SelectedIndexChanged
GetChoicesProc()
FillChoicesProc()
End Sub
Private Sub GetChoicesProc()
Data1.GetDataBase("SELECT * FROM tChoices WHERE StatementID = " & lstStatements.SelectedValue.ToString & " ORDER BY ShowOrder", "tChoices")
End Sub
Private Sub FillChoicesProc()
lstChoices.DataSource = Data1.DataSet.Tables("tChoices")
lstChoices.DisplayMember = "Choice"
lstChoices.ValueMember = "ChoiceID"
End Sub
It seems to work fine until i get to the line...
Code:
lstChoices.ValueMember = "ChoiceID"
Any help here would be greatly appreciated.
Thanks