use a classe SqlConnectionStringBuilder
SqlConnectionStringBuilder conn = new SqlConnectionStringBuilder(ConnectionStringFromConfig)
{ InitialCatalog = "your CatalogName" }; // you can add other parameters.
em seguida, use esta string de conexão quando necessário
conn.ConnectionString;