View Single Post
Old 08-07-2007   #1 (permalink)
Frank
Guest


 
 

How to print out the contents of reader for SQL

Hi,

I am trying to get the output of reader for get the version of sqlserver.
Can someone help me with this?

Thanks,

$conn = new-object System.Data.SqlClient.SqlConnection
$conn.ConnectionString = "server=testserver;integrated
security=true;database=test"
$conn.Open()
$cmd = new-object System.Data.SqlClient.SqlCommand
$cmd.CommandText="SELECT @@VERSION"

$cmd.Connection=$conn
$rdr = $cmd.ExecuteReader()

My System SpecsSystem Spec