You can always do something like this in code:
var host = System.Configuration.ConfigurationManager.AppSettings["dbHostAddress"] var connectionString = System.Configuration.ConfigurationManager. ConnectionStrings["ConnectionString"] .ConnectionString.Replace("REPLACE_VALUE",host);
You simply store the connection string using a placeholder, and then insert it into the code and replace the placeholder value with whatever you want.
Data Source=REPLACE_VALUE;Initial Catalog=Database; Integrated Security=True;Connect Timeout=15
Then I would create a wrapper class around the configuration values ββso that this happens automatically when accessing the property in the code.
source share