Help for newbie filling listbox
Iâm trying to populate a listbox with data that comes from my SQL server. Iâve created the connection, filled the dataset and loaded the data adapter. Apparently, Iâm missing something because after this runs, what is populated in the listbox is: âSystem.Data.DataRowViewâ for each record in my data adapter.
When I click on one of the rows (which really doesnât make sense) as I test the rest of my routine, Iâm able to trick it into showing me other data from that row.
Below is the piece of code that I'm trying to use to load my listbox.
'Fill the data adapter
daEmployeeTree.Fill(dsEmployeeTree, "SuperInfo")
' create data view
Dim dv As DataView = dsEmployeeTree.Tables("SuperInfo").DefaultView
lbxEmployee.DataSource = dv
lbxEmployee.DisplayMember = "SuperInfo"
lbxEmployee.DisplayMember = dv.ToString
Can someone help me fill my listbox with meaningful data? As you can tell, Iâm new to this so any and all help is greatly appreciated.
Thanks,
|