Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# Programmatically create ASP.NET Membership Schema

I was wondering what would be the best way to install the membership schema on the fly.

Right now the solution I'm thinking of is to somehow run aspnet_regsql.exe with arguments to execute on my db connection.

How can I accomplish this? Is there a better way?

like image 419
bevacqua Avatar asked Jun 25 '11 16:06

bevacqua


1 Answers

Ok I found a much better way to accomplish this, I still use the MembershipExists() function, but I install it with this statement, which I didn't know of up until a couple of minutes ago.

SqlServices.Install(database, SqlFeatures.All, connectionString);
like image 82
bevacqua Avatar answered Oct 30 '22 04:10

bevacqua