Created
April 27, 2016 18:04
-
-
Save ATLPhenx/8b7c19bcacd7cfc06b0abcc29a1f5e01 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$conn = New-Object System.Data.SqlClient.SqlConnection | |
$conn.ConnectionString = $connectionString | |
$cmd = New-Object System.Data.SqlClient.SqlCommand | |
$cmd.commandtext = $query | |
$conn.open() | |
#Creates sql command | |
if ($conn.Open()) | |
{ | |
Write-Host "connection established..." | |
} | |
$cmd.connection = $conn | |
#$cmd.executenonquery() | |
$queryResult = $cmd.ExecuteReader() | |
$conn.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment