Public Sub ReadMyData(ByVal myConnString As String)
Dim bigcommerceConnection As New BigcommerceConnection(myConnString)
Dim bigcommerceCommand As BigcommerceCommand = bigcommerceConnection.CreateCommand()
bigcommerceCommand.CommandText = "SELECT id, firstname, lastname FROM customers"
bigcommerceConnection.Open()
Dim bigcommerceReader As BigcommerceDataReader = bigcommerceCommand.ExecuteReader()
Try
' Always call Read before accessing data.
While bigcommerceReader.Read()
Console.WriteLine(String.Concat(bigcommerceReader.GetInt32(0).ToString(), " ", _
bigcommerceReader.GetString(1), " ", bigcommerceReader.GetString(2)))
End While
Finally
' always call Close when done reading.
bigcommerceReader.Close()
' Close the connection when done with it.
bigcommerceConnection.Close()
End Try
End Sub