title: Dynamic Connection String
body: <p>Good Day,</p>
  
  <p>I have two connection strings defined in my web.config file.</p>
  
  <pre><code>&lt;connectionStrings&gt;
      &lt;add name="AppDb" connectionString="CONNECTION-STRING1"/&gt;
      &lt;add name="LaptopDb" connectionString="CONNECTION-STRING2" /&gt;
  &lt;/connectionStrings&gt;
  </code></pre>
  
  <p>When I am working on my desktop, I want to use the connection string "AppDb".  When I am working on my laptop, I want to use the connection string "LaptopDb".  I don't want to comment out the line on the connection string everytime I work on a different machine.</p>
  
  <p>I know that I can programatically do this.  I'm just trying to figure out the best way.</p>
  
  <p>Something like:</p>
  
  <pre><code>if (machineName == desktop)
       use AppDb
  else
       use LaptopDb
  </code></pre>
  
  <p>but I don't like this approach.  Is there something else I can test on?</p>