How to create the ASP.NET Membership tables in your own database?

I never thought that transferring the built-in ASP.NET Membership tables to my own database is as easy as changing the default connection string.  Here are the steps:

1. Add a LINQ To SQL Class to your MVC Project.  Point your new class to your database by adding a table to the dbml file.  This will add a new connection string in your Web.config.

b1

2. Open the Web.config file and comment out the DefaultConnection item in the <connectionStrings> tag.  Cut and paste the newly created connection string and rename it as DefaultConnection.  Compile and run your project and register a sample user.

b2

Thats it!  Try opening your database using your the management tool and look for the newly created tables.

b3

If you find this blog helpful, you can make the donation by clicking the Paypal button below.

Advertisements

3 thoughts on “How to create the ASP.NET Membership tables in your own database?

  1. HI Harold, thanks excellent post.

    I have a question: Would this technique also work for the new ASP.NET Identity tables?

    Thanks.

    Sanjeev

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s