Public Sub ReadMyData(ByVal myConnString As String)
Dim exactTargetConnection As New ExactTargetConnection(myConnString)
Dim exactTargetCommand As ExactTargetCommand = exactTargetConnection.CreateCommand()
exactTargetCommand.CommandText = "SELECT ID, Name, Subject FROM Email"
exactTargetConnection.Open()
Dim exactTargetReader As ExactTargetDataReader = exactTargetCommand.ExecuteReader()
Try
' Always call Read before accessing data.
While exactTargetReader.Read()
Console.WriteLine(String.Concat(exactTargetReader.GetInt32(0).ToString(), " ", _
exactTargetReader.GetString(1), " ", exactTargetReader.GetString(2)))
End While
Finally
' always call Close when done reading.
exactTargetReader.Close()
' Close the connection when done with it.
exactTargetConnection.Close()
End Try
End Sub