Public Sub PrintDept(ByVal myConnection As DbConnectionBase)
Dim myCommand As DbCommandBase = myConnection.CreateCommand()
myCommand.CommandText = "SELECT customer_id, firstname, lastname FROM Customers"
myConnection.Open()
Dim myReader As DbDataReader = myCommand.ExecuteReader()
Try
While myReader.Read()
Console.WriteLine(String.Concat(myReader.GetInt32(0).ToString(), " ", _
myReader.GetString(1), " ", myReader.GetString(2)))
End While
Finally
myReader.Close()
myConnection.Close()
End Try
End Sub