title: Dynamically change connectionstring
body: <p>I'm having a problem where I want to dynamically change a part of my connectionstring in my Web.config file.
  Everywhere I've looked people are saying it is the wrong to place to store it then, but I cannot find anywhere else to put this.</p>
  
  <p>The idea is that I'm connecting to a database and I have to specify the SQL Client. My ASP.net site should be accessible from many different computers, and they have different SQL Clients. <code>Eg. SQL Server Native Client 10.0</code> or <code>SQL Server Native Client 11.0</code>.</p>
  
  <p>I've found a way to retrieve this data as a string, but i cannot figure out how to insert it into my ConnectionString.</p>
  
  <p>An example of my connection string is as follows:</p>
  
  <pre><code>&lt;connectionStrings&gt;
      &lt;add name="name" connectionString="DRIVER=SQL Server Native Client 11.0;server=server;Database=database;Trusted_Connection=Yes; Provider=SQLNCLI11.0" /&gt;
    &lt;/connectionStrings&gt;
  </code></pre>
  
  <p>I want to replace the Provider field <code>SQLNCLI11.0</code> with the string I've managed to create.</p>