diff --git a/src/GUI/SSMSToolbox/SSMSEngine/DatabaseMenuItem.cs b/src/GUI/SSMSToolbox/SSMSEngine/DatabaseMenuItem.cs index 62fbf141..7e97b08c 100644 --- a/src/GUI/SSMSToolbox/SSMSEngine/DatabaseMenuItem.cs +++ b/src/GUI/SSMSToolbox/SSMSEngine/DatabaseMenuItem.cs @@ -119,7 +119,11 @@ private MenuItem BuildMenuItemForCommandHandler() var parent = Parent; if (parent?.Connection == null) return null; - var builder = new SqlConnectionStringBuilder(parent.Connection.ConnectionString); + var connectionString = parent.Connection.ConnectionString; + + connectionString = ReplaceMdsKeywords(connectionString); + + var builder = new SqlConnectionStringBuilder(connectionString); builder.InitialCatalog = parent.InvariantName; var dbInfo = new DatabaseInfo @@ -175,5 +179,12 @@ private ToolStripMenuItem BuildScriptMenuItem(System.Drawing.Bitmap scriptImage) scriptItem.DropDownItems.Add(scriptItem5); return scriptItem; } + + private string ReplaceMdsKeywords(string connectionString) + { + connectionString = connectionString.Replace("Multiple Active Result Sets=", "MultipleActiveResultSets="); + connectionString = connectionString.Replace("Trust Server Certificate=", "TrustServerCertificate="); + return connectionString; + } } }