title: ASP.NET ASPNETDB.MDF Cannot open database
body: <p>I am using membership class for my user management, and it created a database called ASPNETDB.MDF.. I decided to use the same database to handle my other data, and so  I added some of my own tables in there...</p>
  
  <p>When I try to access it:</p>
  
  <pre><code>    &lt;connectionStrings&gt;
      &lt;add name="connString" connectionString="Initial Catalog=MyProject;Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\MyName\Documents\Visual Studio 2008\Projects\Project\MyProject\App_Data\ASPNETDB.MDF;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" /&gt;
  &lt;/connectionStrings&gt;
  </code></pre>
  
  <p>Using this:</p>
  
  <pre><code>Dim conn As SqlConnection = New SqlConnection(ConfigurationManager.ConnectionStrings("connString").ToString)
  </code></pre>
  
  <p>It gives me this error after I log in through Membership class:</p>
  
  <pre><code>    Cannot open database "MyProject" requested by the login. The login failed.
  Login failed for user 'My-PC\Myuser'.
  </code></pre>
  
  <p>I am not sure what's going on?</p>
  
  <p>Edit: If i don't use Membership class, I can use the database fine.. but when after I login using the membership class, it stops to work..</p>