I built a new form. There is combobox that I want to fill from database
Now that line: Dim B_Name = rdrOLEDB.GetString("id")
will bring me one field only, but I want both the name and the id field. One for display, and the other would be the value that I will use as a reference for the combobox controller.
Any idea how to do this in VB.Net 2013??
VB.NET:
sqlquery.CommandText = "SELECT * FROM Buildings"
Dim rdrOLEDB As OleDb.OleDbDataReader = sqlquery.ExecuteReader
While rdrOLEDB.Read
Dim B_Name = rdrOLEDB.GetString("id")
Buildings_List.Items.Add(B_Name)
End While
will bring me one field only, but I want both the name and the id field. One for display, and the other would be the value that I will use as a reference for the combobox controller.
Any idea how to do this in VB.Net 2013??