views:

999

answers:

2

I would like to use the ASP.NET Membership Provider security framework but would like it to use SQL Server schema's. So instead of having tables such as aspnet_Membership I would prefer it to be something like sec.Membership. Has anyone tried this and got it to work?

+4  A: 

I believe the table names are hard-coded into the default SQL providers for ASP.NET. You'll have to implement custom providers to do the same things as the default providers, but using an alternate table name instead. This article can help you figure out how to write custom providers.

Chris Charabaruk
+1  A: 

Been a while, but when you create the ASPNET Membership provider into your database, doesn't it create a whole bunch of stored procedures that are used by the provider its self? If so you could edit the table names, and update the stored procedures as required. The stored procuedure names would have to remain as generated though...

Might be easier to just make a custom provider as recommended, but its potentially another option...

RM
I think you would have to edit the stored procedures, but I think that is the easy bit! All the .NET code in the MemberShip Provider seems to have hard coded the dbo. when calling the stored procedures. I think that is a bad design decision that should be resolved.
Craig
@Ross Actually, the stored procedures and tables are created by a seperate tool, which needs to be run explicitly if you're not using a database created by the project template.
Chris Charabaruk