Sqlserver
 sql >> Database >  >> RDS >> Sqlserver

Modifica dinamica della stringa di connessione

usa la classe SqlConnectionStringBuilder

SqlConnectionStringBuilder conn = new SqlConnectionStringBuilder(ConnectionStringFromConfig)
   { InitialCatalog = "your CatalogName" }; // you can add other parameters.

quindi usa questa connectionstring dove richiesto

conn.ConnectionString;