i have a single column datatable and a listbox
in the following function i am trying to set the listbox item source to the datatable but it displays the rows as System.Datarow
Private Sub setghostshopslistitemsource()
GhostShopsList.Items.Clear()
Dim con As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & mydocumentddir & "\Settings\Settings.mdb")
GhostsDatatableda = New OleDbDataAdapter("Select Ghost From GhostsTable", con)
GhostsDatatableda.Fill(GhostsDatatable)
GhostShopsList.ItemsSource = GhostsDatatable.DefaultView
End Sub
so what is wrong with the last line?
The Datatable Look like
Ghosts
Text1
Text2
Text3
.
.
.
and i just want to display each text in the listbox
using the above function the listbox displays
System.Data.DataRow
System.Data.DataRow
System.Data.DataRow
.
.
.
You need to specify how the rows should be displayed. If you just need a text box, then write something like this: