Dim con As New SqlConnection("Data Source=60016P05260;Initial Catalog=NorthWind;Integrated Security=True") Dim cmd As New SqlCommand() cmd.CommandText = "SELECT * FROM Categories; SELECT * FROM Customers" cmd.Connection = con Try con.Open() Dim reader As SqlDataReader = cmd.ExecuteReader() Do 'PerformanceCounter visualizzare il contenuto di ogni singolo campo, specificare Reader(numero colonna) While reader.Read() Try Debug.Print(reader(0) & vbTab & reader(1) & vbTab & reader(2) & vbTab & reader(3)) Catch ex As Exception Debug.Print(reader(0) & vbTab & reader(1)) End Try End While Loop While reader.NextResult() reader.Close() Finally con.Close() End Try |