Menu Close

Preparing your MS SQL database for use with ASP.NET Membership Provider

The ASP.NET Membership provider by default, will use a SQL Express database.  But if you want to use a database on an external SQL Database, you must prepare it.

This method uses Visual Studio 2008 (.NET 3.5) but will also work with ASP.NET 2.0.  It assumes you have already created a database(empty) and user name.

1)Go to Start Menu>Programs>Microsoft Visual Studio 2008>Visual Studio Tools>Visual Studio 2008 Command Prompt

2)You will enter the following command(with the appropriate values)

aspnet_regsql.exe -U UserName -S ServerNameOrIp -d DatabaseName -A m

3)Doing this creates all necessary tables and objects in your database to support the membership provider.  

4)After preparing the database, you are ready to add the connection string to you web.config.

For more information on using the ASP.NET Membership Provider, see the MSDN article here.