1
Hello, good morning!
I have a project where there are two scenarios, which is approval and production. In this same project I created two connectionstrings
, setting one for each scenario.
In the system these scenarios are divided into subdomains, such as Homolog.dominio.com.br and the domain.com.br itself.
Now comes the question:
There is a way to create a configuration for the connectionstring
adapt to the scenario? When I access the Homolog it automatically picks up the connectionstring
of approval.
It’s like this:
<connectionStrings>
<add name="connectionstring_homolog" providerName="System.Data.SqlClient" connectionString="Data Source=xxxx;Initial Catalog=xxxxxx; User ID=xxxxxx; pwd=xxxxxxx;" />
<add name="connectionstring_prod" providerName="System.Data.SqlClient" connectionString="Data Source=xxxxxx;Initial Catalog=xxxxxx; User ID=xxxx; pwd=xxxxx;" />
</connectionStrings>
Remembering that I am using ASP.Net MVC.
Thank you in advance.
You can set up web.config to swap with Debug and Release. ?
– Jhonathan
Hello Jhonathan, I am trying to do through a session, do not know if it is a good practice, more how would that idea? Could I explain? Thank you.
– Bruno