title: Code First Entity Framework - change connection string
body: <p>How do I change the connection string in a code first entity framework/MVC application?  I'm trying to transfer it to a live site, but it overlooks web config values and still references my local version of the database.</p>
  
  <p>Here is the connection string section of my web.config:</p>
  
  <pre><code>&lt;add name="MembershipConnectionString" connectionString="Data Source=192.168.1.43;Initial Catalog=Website.Models.IntranetApplication;User Id=[UserName];Password=[Password];timeout=30" /&gt;
  &lt;add name="WebsiteConnectionString" connectionString="Data Source=192.168.1.43;Initial Catalog=Website.Models.IntranetApplication;User Id=[UserName];Password=[Password];timeout=30" /&gt;
  &lt;add name="Entities" connectionString="metadata=res://*/Models.IntranetModel.csdl|res://*/Models.IntranetModel.ssdl|res://*/Models.IntranetModel.msl;provider=System.Data.SqlClient;provider connection string=&amp;quot;Data Source=192.168.1.43;Initial Catalog=Website.Models.IntranetApplication;User Id=[UserName];Password=[Password];MultipleActiveResultSets=True&amp;quot;" providerName="System.Data.EntityClient" /&gt;
  </code></pre>
  
  <p>I'm not sure if the Entities string has any relevance, as I used Code First entity framework, and I think that only appeared when I tried to create an edmx file (although I ended up just deleting it). The Entities connection string has sat commented out so I don't think it's used.</p>
  
  <p>I want entity framework to read the "WebsiteConnectionString", but it seems to want to use the local connection string, but I can't even see where that is set.  How do I change it?</p>