Agent909
asked on
How do I load data into List (Of T)
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:
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
cmd.ExecuteNonQuery()
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.