Where is the database for the built in user part of asp.net MVC2?

User registration/authentication seems to be built into MVC2 but where does is the database that stores the users? It's not under data connections.

Answers


The database is first created when you create the first user for the website. After that the .mdf file is in app_data folder.

If you want it to be shown in VS, you can click Project -> Show all files and then it should be visible in Solution Explorer. Right click ASPNETDB.MDF and click Include in project.


The default template uses SQL Express edition. An aspnetdb.mdf file will be stored in the App_Data directory. Look at the connection string in web.config:

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

u don't have to use aspnet_regsql.exe tool - just start your app, register new user, and then open the app_data directory in windows explorer - u will find your db file over there

Arek


Need Your Help

Python Ensure File ends in line return?

python file

I would like to have a function which takes in a path to a file, checks if the file ends in an \n, and add in a \n if it doesn't.

C# SQL AND condition not working on string data

c# sql

I was hoping someone could help me out with this stupid problem I'm having with the following SQL statement:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.