Created
May 2, 2016 20:54
-
-
Save ATLPhenx/781ff6dc93258916f975d164a0fbe96d 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
function selectPOSData ($Server, $Database, $Username, $Password) { | |
$Connection = New-Object System.Data.SQLClient.SQLConnection | |
$Connection.ConnectionString = "server=$Server;database=$Database;User ID= $Username; Password= $Password;" | |
$Command = New-Object System.Data.SQLClient.SQLCommand | |
$Connection.Open() | |
$Command.Connection = $Connection | |
$Command.CommandText = 'somequery' | |
# Fill the DataSet. | |
$ds=New-Object system.Data.DataSet | |
$da=New-Object system.Data.SqlClient.SqlDataAdapter($Command) | |
$da.fill($ds) | Out-Null | |
$Connection.Close() | |
return $ds | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment