' Collection of code snippets by Arne Vajhøj ' posted to eksperten.dk, usenet and other places (2002-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