title: Not able to connect to sql for membership in Visual studio 2008
body: <p>Okay, this thing is driving me insane, I have tried every way, I have SQL 2008 (running as an instance on my pc named <em>Razor-PC</em> and visual studio sp1, I want to use Login and Logout controls (asp.net membership) so I tried to connect in following ways. Also, in vs I have set the (tools -> options -> database tools-> Data connection -> SQL server instance name (left it blank) ) After creating a default website and without messing around even a single thing, I did the following  </p>
  
  <ol>
  <li><p>In web.config changed Authentication to "Forms" and then in default.aspx added login control and ran the site and entered some random info into login view in the hope that though login will surely fail, asp.net will behind the secne create the membership's database (aspnetdb) and make all the connections itself to database. But nothing happened I didn't get any database in app_data and I found error msg as "<strong>A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections."</strong></p></li>
  <li><p>I tried (starting from scratch) changed the authentication to forms, then ran aspnet_regsql it did created the database in sql with no problems, but then after that, I ran wat and then when in provider tab, I selected "select a single provider for all site management" and cicked the "test" next to AspNetSqlProvider it said "<strong>Could not establish a connection to the database.
  If you have not yet created the SQL Server database, exit the Web Site Administration tool, use the aspnet_regsql command-line utility to create and configure the database, and then return to this tool to set the provider</strong>."</p></li>
  <li><p>Started site (again from scratch) and then changed authentication to "Forms" and added this manually, </p>
  
  <pre><code>&lt;connectionStrings&gt;
  &lt;add name="SQLMembership" connectionString="Data Source=RAZOR-PC; initial catalog=aspnetdb; integrated security=true"/&gt;
  &lt;/connectionStrings&gt;
  </code></pre></li>
  </ol>
  
  <p>and also added the following manually</p>
  
  <pre><code>&lt;membership&gt;
  &lt;providers&gt;
  &lt;add connectionStringName="SQLMembership" name="AspNetSqlProvider" Type="System.Web.Security.SqlMembershipProvider" /&gt;
  &lt;/providers&gt;
  &lt;/membership&gt;
  </code></pre>
  
  <p>but still it doesn't connect, it keeps coming up with same error I mentioned in point 2, can any one please tell me what am I doing wrong???</p>