![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| 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 Specs![]() |
| | #2 (permalink) |
| Guest | RE: How to print out the contents of reader for SQL I guess, I can do this: $cmd.CommandText=" SELECT @@Version as version" $rdr = $cmd.ExecuteReader() While($rdr.Read()){ $version = $rdr['version'] } $conn.Close() $version "Frank" wrote: > 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 Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Does the Hp6730s laptop has finger print reader/scanner?? | Drivers | |||
| Print Folder Contents | Vista General | |||
| Vista Can't Print to Win2K shared printer-Test Print disappears fr | Vista networking & sharing | |||
| Unable to Print or Print Preview from IE7 on Vista Home Premium | Vista print fax & scan | |||
| Acrobat reader crashes when trying to print | Vista print fax & scan | |||