Public Sub ReadMyData(ByVal myConnString As String)
Dim quickBooksConnection As New QuickBooksConnection(myConnString)
Dim quickBooksCommand As QuickBooksCommand = quickBooksConnection.CreateCommand()
quickBooksCommand.CommandText = "SELECT Id, DisplayName, Notes FROM Customer"
quickBooksConnection.Open()
Dim quickBooksReader As QuickBooksDataReader = quickBooksCommand.ExecuteReader()
Try
' Always call Read before accessing data.
While quickBooksReader.Read()
Console.WriteLine(String.Concat(quickBooksReader.GetString(0), " ", _
quickBooksReader.GetString(1), " ", quickBooksReader.GetString(2)))
End While
Finally
' always call Close when done reading.
quickBooksReader.Close()
' Close the connection when done with it.
quickBooksConnection.Close()
End Try
End Sub