Water Cooler v2
Water Cooler v2

Reputation: 33850

Can't see the database used by the default MVC Account Controller/ASP.NET Membership provider

I fired up a new Internet application type MVC 3 project. It has an Account Controller that works using the default ASP.NET membership provider.

The web.config of the project has the following connection string:

connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"
         providerName="System.Data.SqlClient" />

I do have SQLEXPRESS on my machine, but when I look up the databases in the Management Studio, I do not see any database created for membership. I only see the ones that I created.

Where does ASP.NET MVC create this membership database?

Upvotes: 1

Views: 873

Answers (1)

Rory McCrossan
Rory McCrossan

Reputation: 337560

You are using a User Instance (contained the fileaspnetdb.mdf in your SQL installations' data directory) not an embedded database within SQLExpress, which is why you don't see it in SSMS.

Here's an explanation of what this is and how to interrogate the data within it, should you need to.

Upvotes: 1

Related Questions