Skip to content

Instantly share code, notes, and snippets.

@hugotai101
Created May 6, 2021 06:38
Show Gist options
  • Save hugotai101/d5e96fc62daf988968ba56aa6b6b9c66 to your computer and use it in GitHub Desktop.
Save hugotai101/d5e96fc62daf988968ba56aa6b6b9c66 to your computer and use it in GitHub Desktop.
Powershell
$ServerName = '192.168.1.188'
$DatabaseName = 'Dbname'
$UserName = 'username'
$password = 'password'
$connectionString = 'Data Source={0};database={1};User ID={2};Password={3}' -f $ServerName,$DatabaseName,$userName,$password
$sqlConnection = New-Object System.Data.SqlClient.SqlConnection $connectionString
$sqlConnection.Open()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment