Public Sub ReadMyData(ByVal myConnString As String)
Dim freshbooksConnection As New FreshBooksConnection(myConnString)
Dim freshbooksCommand As FreshBooksCommand = freshbooksConnection.CreateCommand()
freshbooksCommand.CommandText = "SELECT Id, FirstName, LastName FROM Client"
freshbooksConnection.Open()
Dim freshbooksReader As FreshBooksDataReader = freshbooksCommand.ExecuteReader()
Try
' Always call Read before accessing data.
While freshbooksReader.Read()
Console.WriteLine(String.Concat(freshbooksReader.GetString(0), " ", _
freshbooksReader.GetString(1), " ", freshbooksReader.GetString(2)))
End While
Finally
' always call Close when done reading.
freshbooksReader.Close()
' Close the connection when done with it.
freshbooksConnection.Close()
End Try
End Sub