title: Dynamically Create DB Connection String for Entity in MVC 4
body: <p>I have an entity in MVC 4 project and the connection string is placed in the web.config by the entity creation wizard.</p>
  
  <p>I need to change this and assign the password to the connection string (which is stored outside the web.config) at run time.</p>
  
  <ol>
  <li><p>How can I combine values outside the web.config with a string stored inside the web.config?</p></li>
  <li><p>Or can I move the entity connection completely outside the web.config?</p></li>
  </ol>
  
  <p><strong>This is the existing entity connection string:</strong></p>
  
  <pre><code>add name="MyEntities" connectionString="metadata=res://*/Models.NewUsers.csdl|res://*/Models.NewUsers.ssdl|res://*/Models.NewUsers.msl;provider=System.Data.SqlClient;provider connection string=&amp;quot;data source=mydb;initial catalog=MyDatabase;persist security info=True;user id=sa;password=Mypassword;MultipleActiveResultSets=True;App=EntityFramework&amp;quot;" providerName="System.Data.EntityClient" /&gt;&lt;/connectionStrings&gt;
  </code></pre>