views:

39

answers:

3

ASP.NET Membership is just great as there are a ton of functionality right there to be used, and we don't need to change nothing at all.

We can even create our own Provider based on Membership database, and that give us infinite possibilities, like as I don't like the Question/Answer I just use an email that is sent with a reset link.

But this is all done with SQLEXPRESS .mdf file and I wanted to use my own Database for this so I can use SQL Server Enterprise as we have in the Office and not the Express Edition.

How can I easily use the ASP.NET Membership tables in my own Database?

I rememebered some years ago that we needed to use aspnet_reg (something) to create the correct tables, but I can't find that info anymore.

I also tried to use other Membership Providers, namely Altairis.Web.Security from CodePlex and saw the Chris Pels Video on creating a new Membership Provider

On Altairis solution, the Model is not complete and lack several points such as Several Applications as it's made to be used with only one, and Chris Pels contains to much Store Procedures that I need to create by hand.

I'm for given Chris code a go but I just wanted to know if there would be available something easier.

All this is to be integrated in ASP.NET MVC 2 Web Application.

Thanks

+3  A: 

It's aspnet_regsql

Under the following path: C:\windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regsql

A_Nablsi
or v2.??? if you are using .net framework 2.0
A_Nablsi
the tag `asp.net-mvc-2` inherits from .NET 3.5 SP1+ :)
balexandre
A: 

You need to open up the Visual Studio Command Prompt, navigate to C:\WINDOWS\Microsoft.NET\Framework\\aspnet_regsql.exe . Some example are located in the MSDN documentation.

Example: aspnet_regsql.exe -E -S localhost -A mr - installs the database elements for membership and role management on the local computer running SQL Server using Windows authentication.

Zaffiro
+2  A: 

You have 3 options:

  1. Do it by running aspnet_regsql.exe: Just open "Start Menu>All Programs>Microsoft Visual Studio 2010>Visual Studio Tools>Visual Studio Command Prompt(2010)" and then type aspnet_regsql. A wizard appears and let you select your desired database.

  2. Do it via API: Use System.Web.Management.SqlServices class and its Install and Uninstall methods. This will programmatically install/uninstall database artifacts.

  3. Do it manually: Go to C:\Windows\Microsoft.NET\Framework\v4.0.30319 or something like. You will find 9 .sql files that begins with Install and 9 .sql files that begins with uninstall. You can run them manually in your database to create needed tables/store procedures/etc. But consider changing database name in sql scripts. Default db name is aspnetdb.

afsharm