Hello,
This is likely an easy question, but I've never dealt with using a DataBase in VB before.
I am using an Access Database to populate items in my ComboBox. I am trying to make it so when you select an item from the ComboBox, it goes into the ListBox. When I debug and try to add items, the ListBox shows "System.Data.DataRowView" when I don't have the Adapter code included, and a "value cannot be Null" error when it is. The ComboBox is populating items from 4 ToolStrips (Sea, Land, Air, Space), the user clicks the ToolStrip button and the appropriate items display.
My code for the ComboBox is-
How can I get this to work? Any help would be appreciated!
This is likely an easy question, but I've never dealt with using a DataBase in VB before.
I am using an Access Database to populate items in my ComboBox. I am trying to make it so when you select an item from the ComboBox, it goes into the ListBox. When I debug and try to add items, the ListBox shows "System.Data.DataRowView" when I don't have the Adapter code included, and a "value cannot be Null" error when it is. The ComboBox is populating items from 4 ToolStrips (Sea, Land, Air, Space), the user clicks the ToolStrip button and the appropriate items display.
My code for the ComboBox is-
VB.NET:
Private Sub cboToys_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles cboToys.SelectedIndexChanged
'Toys CBO
'Me.TOYAISLETableAdapter.MaleToys(Me.KillinsdatabaseDataSet.ITEMS)
lstItems.Items.Add(cboToys.SelectedItem)
End Sub
How can I get this to work? Any help would be appreciated!