I have an application which accesses a database consisting of one table (Customers) with two fields (LastName and FirstName). I drug the data source onto my form which automatically generated a data set, binding source, table adapter, table adapter manager, and a binding navigator. (I do not pretend to fully understand what each of these does). This automatically generated text boxes for FirstName and LastName.
I want to load the data into an unbound listbox.
This code works:
For i = 1 To CustomersBindingSource.Count
ListBox1.Items.Add(Me.LastNameTextBox.Text + ", " + Me.FirstNameTextBox.Text)
My listbox fills with last and first names.
But, if I change the visible property of the textboxes to False, the listbox fills with commas.
I do not need the textboxes to be present except to make the above code work.
Is there some way to get the data directly from the Binding Source (or Table Adapter or Binding Navigator, etc.)?