-
building cbo boxes
what am I doing wrong?
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
OleDbConnection1.Open()
OleDbDataAdapter1.SelectCommand.CommandText = "SELECT Location, HotelID FROM Hotel"
OleDbDataAdapter1.SelectCommand.ExecuteNonQuery()
Do
ComboBox1.Items.Add(OleDbDataAdapter1.SelectCommand.CommandText)
Loop
OleDbConnection1.Close()
End Sub
-
Quote:
what am I doing wrong
Calling ExecuteNonQuery to execute the Select statement (which is a query).
Adding the same value to the combobox each time.
There is an endless loop.