mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
Merge pull request #124 from Icinga:fix/mssql_open_connection_empty_db
Fixes MSSQL connection string on empty DB
This commit is contained in:
commit
b39af24b14
1 changed files with 1 additions and 1 deletions
|
|
@ -68,7 +68,7 @@ function Open-IcingaMSSQLConnection()
|
||||||
$SqlConnection = New-Object System.Data.SqlClient.SqlConnection;
|
$SqlConnection = New-Object System.Data.SqlClient.SqlConnection;
|
||||||
$SqlConnection.ConnectionString = "Server=$Address,$Port;";
|
$SqlConnection.ConnectionString = "Server=$Address,$Port;";
|
||||||
|
|
||||||
if ($null -ne $SqlDatabase) {
|
if ([string]::IsNullOrEmpty($SqlDatabase) -eq $FALSE) {
|
||||||
$SqlConnection.ConnectionString += "Database=$SqlDatabase;";
|
$SqlConnection.ConnectionString += "Database=$SqlDatabase;";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue