title: DefaultConnection and membership - what is the connection between localsqlserver and defaultconnection
body: <p>Hmmmm... I really can't get my head around this. </p>
  
  <p>In web.config I have:</p>
  
  <pre><code>&lt;connectionStrings&gt;
     &lt;clear /&gt; &lt;!--- need this to prevent using LocalSqlServer from machine.config or somewhere becouse it is not present when when publish to hosting --&gt;
     &lt;add name="DefaultConnection" providerName="System.Data.SqlClient" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=aspnet-Goaly-20120615111028;Integrated Security=SSPI" /&gt;  
  &lt;/connectionStrings&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>&lt;membership defaultProvider="DefaultMembershipProvider"&gt;
    &lt;providers&gt;
      &lt;!-- I think this line is telling asp.net that I want the membership working agains defaultconnection, and not LocalSqlServer connection????? --&gt;
      &lt;add name="DefaultMembershipProvider" type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" /&gt;
    &lt;/providers&gt;
  &lt;/membership&gt;
  </code></pre>
  
  <p>But then it is complaining:</p>
  
  <pre><code>The connection name 'LocalSqlServer' was not found in the applications configuration or the connection string is empty.
  </code></pre>
  
  <p>When I use the publish from VS2012 RC in the settings tab I get a ModelContext and a DefaultConnection, so how is this supposed to work? </p>
  
  <p>What I want is simply to get the membership tables in the same database as the tables created by modelcontext. </p>
  
  <p>This should be so oob, but I must have overcomplicated it some how. </p>
  
  <p>Thanks for any help.</p>
  
  <p>Regards</p>
  
  <p>Larsi</p>