I have a web server with multiple application running. All the application have their web.config
file. If the database password changes due to Policy I have to manually change the password in each of web.config
files in the app setting section.
I was reading about the connection string setting in machine.config
file.
Now my question is if I put connection string in appsetting section of machine.config
with name ConnectionString
and same in my web.config
file will it overwrite the machine.config
file values.
In my machine.config
following is the setting
<configuration>
....
<appSettings>
<add key="ConnectionString" value="value"/>
</appSettings>
</configuration>
similarly in my web.config
file
<configuration>
....
<appSettings>
<add key="ConnectionString" value="value"/>
</appSettings>
</configuration>
And I get the value in my code as below
string conString=ConfigurationManager.AppSettings["ConnectionString"];
will I get the overloaded value?