' Collection of code snippets by Arne Vajhøj 
' (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
Imports System
Imports System.Data
Imports System.Data.SqlClient

Class MainClass
    Public Shared Sub Main(ByVal args As String())
        Dim con As SqlConnection = New SqlConnection("server=ARNEPC2;Integrated Security=SSPI;database=Test")
        con.Open
        Dim cmd As SqlCommand = New SqlCommand("SELECT * FROM T1", con)
        Dim rdr As SqlDataReader = cmd.ExecuteReader
        While rdr.Read
            Console.WriteLine(rdr(0) & " " & rdr(1))
        End While
        rdr.Close
        con.Close
    End Sub
End Class 
