title: entity framework database issue - A network-related or instance-specific error occurred while establishing a connection to SQL Server
body: <pre><code>A network-related or instance-specific error occurred while establishing a connection to SQL Server
  </code></pre>
  
  <p>The main page loads fine, but the error occurs when I try to goto Account/Register or Account/Login.</p>
  
  <p>The error occurs on this line in SimpleMembershipInitializer constructor in file Filters/InitializeSimpleMembershipAttribute.cs</p>
  
  <pre><code>if (!context.Database.Exists())
  </code></pre>
  
  <p>Now, if I set my web.config to </p>
  
  <pre><code>&lt;entityFramework&gt;
      &lt;defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework" /&gt;
  &lt;/entityFramework&gt;
  </code></pre>
  
  <p>it works locally only but I'm assuming it's using a local database. Right now my entity framework in the web.config looks like</p>
  
  <pre><code>&lt;defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" /&gt;
  </code></pre>
  
  <p>I have another application where I am using the same hosting service and free database (appharbor and SQL Server Yocto) and it works just fine. I recently setup a new application and database and it doesn't work. I can connect to the database fine in SQL server and expanding the DataConnections -> MyContextName in visual studio 2012, so I know the connection string is not the problem.</p>
  
  <p>I'm wondering if there is a problem on the server the database is hosted on and I don't have access to that. </p>
  
  <p>I'm all out of ideas on how to fix this problem. Thanks.</p>