Public Sub ReadOrderData(ByVal connectionString As String)
Dim commandText As String = "SELECT OrderID, CustomerID FROM dbo.Orders;"
Using connection As New SqlConnection(connectionString)
Using command As New SqlCommand(commandText, connection)
connection.Open()
Using reader As SqlDataReader = command.ExecuteReader()
While reader.Read()
Console.WriteLine(String.Format("{0}, {1}", _
reader(0), reader(1)))
End While
End Using
End Using
End Using
End Sub