Public Sub ReadMyData(ByVal myConnString As String)
Dim mailchimpConnection As New MailChimpConnection(myConnString)
Dim mailchimpCommand As MailChimpCommand = mailchimpConnection.CreateCommand()
mailchimpCommand.CommandText = "SELECT Id, Name, Type FROM Folders"
mailchimpConnection.Open()
Dim mailchimpReader As MailChimpDataReader = mailchimpCommand.ExecuteReader()
Try
' Always call Read before accessing data.
While mailchimpReader.Read()
Console.WriteLine(String.Concat(mailchimpReader.GetInt32(0).ToString(), " ", _
mailchimpReader.GetString(1), " ", mailchimpReader.GetString(2)))
End While
Finally
' always call Close when done reading.
mailchimpReader.Close()
' Close the connection when done with it.
mailchimpConnection.Close()
End Try
End Sub