title: Dynamically change connectionString in web.config
body: <p>I have the following in my web.config</p>
  
  <pre><code>&lt;connectionStrings&gt;
     &lt;add name="ActiveDirectoryConnection" connectionString="LDAP://ActiveDirectoryDomain1.com" providerName="System.Web.Security.ActiveDirectoryMembershipProvider"/&gt;
  &lt;/connectionStrings&gt;
  </code></pre>
  
  <p>I need to add a dropdown box to my login page that allows the user to change the connectionString to a different string, e.g. "LDAP://ActiveDirectoryDomain2.com"</p>
  
  <p>In C# code behind how do change the connectionString value?</p>
  
  <p><hr>
  More info:</p>
  
  <p>The problem I am having is that there are 4 other web.config settings call that one connectionString. For example: </p>
  
  <pre><code>&lt;activeDirectorySecurityContextSettings connectionStringName="ActiveDirectoryConnection" defaultADUserName="ReportUser" defaultADPassword="password"/&gt;  
  </code></pre>
  
  <p>Thanks!</p>