I am writing a new application and can't remember how to load data from a database into List(Of T). MS Access was the best choice for this customer, so I'm using OleDB. I have a class called Store that has the properties for the Store table's data.
How do I populate the List(Of T)?
Here's my code so far:
Private Sub LoadStores()
Dim colStores As New List(Of Store)
objConnection = objEngine.GetConnection
Dim sql As String = "SELECT StoreID,StoreAbbreviation,StoreState,StoreName "
sql &= "FROM Stores ORDER BY StoreName;"
Dim cmd As New OleDb.OleDbCommand
cmd.CommandText = sql