![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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 Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
|
| | LinkBack | Thread Tools | Display Modes |
| | #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 | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Vista Can't Print to Win2K shared printer-Test Print disappears fr | Jeremy | Vista networking & sharing | 2 | 06-29-2008 02:31 PM |
| Unable to Print or Print Preview from IE7 on Vista Home Premium | Poppy | Vista print fax & scan | 8 | 05-13-2008 01:56 AM |
| After printing several documents, the print queue hangs, print st | FredJ | Vista print fax & scan | 3 | 04-19-2008 04:33 PM |
| HOw do I start the print spooler so I can install my print drivers? | jaczar | Vista installation & setup | 3 | 12-17-2007 08:42 PM |
| Acrobat reader crashes when trying to print | cindywads | Vista print fax & scan | 0 | 11-21-2007 11:41 PM |