Imports System.Data.SqlClientModule Module1 Sub Main() Dim conStr As String = _ "Initial Catalog=AdventureWorks;" & _ "Data Source=localhost;Integrated Security=SSPI;" Dim con As SqlConnection = New SqlConnection(conStr) ' Create the command object. Dim cmd As SqlCommand = New SqlCommand("SELECT * FROM Person.Contact") cmd.Connection = con ' Open the connection and execute the command. con.Open() Dim dr As SqlClient.SqlDataReader = cmd.ExecuteReader() Console.WriteLine("HAS ROWS?: " & dr.HasRows) dr.Close() con.Close() Console.WriteLine() Console.WriteLine("PRESS ANY KEY TO EXIT") Console.ReadLine() End SubEnd Module