views:

31

answers:

1

I was reading through this post here http://www.misfitgeek.com/op-ed/adding-asp-net-membership-to-your-own-database

and thought to my self what the common practice is. What do developers using ASP.NET membership and authorization in their applications recommend as a best practice? creating the membership tables in the same database that stores their applications data or configuring a second database to store ONLY the membership information?.

My current setup is a different database for membership information ONLY but am thinking that increases the number of databases i have to maintain. If I have 5 applications using asp.net membership, then that means 5 more asp.net membership databases.

So do you normally create the asp.net membership tables in your main database or you configure a separate membership table? what do you recommend.

+1  A: 

I personally just added the asp.net membership stuff to my own database. I then wrote a basic wrapper class around System.Web.Security.Membership class so that the code acts like its using its own membership stuff. Its pretty slick and not that hard to do. If you need assistance setting it up, here is what I did.

The link you provided on how to set it up is waaaaaaaaaayy more complicated that what I used:

  1. Run C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regsql.exe.
  2. Hit Next.
  3. Select “Configure SQL Server for application services…” and hit Next.
  4. Select “Windows Authentication” and the “XXXX” Database and hit Next.
  5. Your settings are then presented...then hit Next.
  6. Finally you should be presented with a done screen, hit Finish.

I have screenshots in the doc if you really need the walkthrough.

John
OK. i can setup the tables in any database of my choice quite easily. Now if i export the user info from the old database tables to the new tables, do you there is any thing that might break. Will the old user's passwords and related profile information still work if exported to the tables in the new database. Basically, i would not like to re-create my user accounts, i would just like to copy them over, edit the connection String and get the website users continue logging in as though nothing ever happened. Is that going to be possible or i must re-create the already existing users?
Name.IsNullOrEmpty
I would think you could just copy the data, but I haven't actually done it. I'd backup everything first. If you try the transfer and its doesn't work, did you really lose anything? Probably not, because (A) you have a backup and (B) its going to take wwaaay longer to hand recreate stuff.
John