diff --git a/src/Microsoft.SqlTools.ServiceLayer/Admin/AdminService.cs b/src/Microsoft.SqlTools.ServiceLayer/Admin/AdminService.cs index b361656e..19b3985b 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Admin/AdminService.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/Admin/AdminService.cs @@ -217,6 +217,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Admin false, connectionDetails.UserName, passwordSecureString, + connectionDetails.DatabaseName, xmlDoc.InnerXml); } else @@ -227,6 +228,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Admin true, null, null, + connectionDetails.DatabaseName, xmlDoc.InnerXml); } diff --git a/src/Microsoft.SqlTools.ServiceLayer/Admin/Common/DataContainer.cs b/src/Microsoft.SqlTools.ServiceLayer/Admin/Common/DataContainer.cs index f7a7e2ce..0d476350 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Admin/Common/DataContainer.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/Admin/Common/DataContainer.cs @@ -684,7 +684,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Admin /// User name for not trusted connections /// Password for not trusted connections /// XML string with parameters - public CDataContainer(ServerType serverType, string serverName, bool trusted, string userName, SecureString password, string xmlParameters) + public CDataContainer(ServerType serverType, string serverName, bool trusted, string userName, SecureString password, string databaseName, string xmlParameters) { this.serverType = serverType; this.serverName = serverName; @@ -692,7 +692,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Admin if (serverType == ServerType.SQL) { //does some extra initialization - ApplyConnectionInfo(GetTempSqlConnectionInfoWithConnection(serverName, trusted, userName, password), true); + ApplyConnectionInfo(GetTempSqlConnectionInfoWithConnection(serverName, trusted, userName, password, databaseName), true); //NOTE: ServerConnection property will constuct the object if needed m_server = new Server(ServerConnection); @@ -1031,7 +1031,8 @@ namespace Microsoft.SqlTools.ServiceLayer.Admin string serverName, bool trusted, string userName, - SecureString password) + SecureString password, + string databaseName) { SqlConnectionInfoWithConnection tempCI = new SqlConnectionInfoWithConnection(serverName); tempCI.SingleConnection = false; @@ -1047,6 +1048,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Admin tempCI.UserName = userName; tempCI.SecurePassword = password; } + tempCI.DatabaseName = databaseName; return tempCI; }