How to set up a membership provider to insert data into my own database

How to set up a membership provider to insert data into my own database

+2


a source to share


2 answers


Write to the membership manufacturer to use your custom database (if you want to use a completely different database schema) or follow these steps:



How do I change the ASP.NET membership database

+2


a source


You can create a custom MemberhipProvider to work with a custom authentication system. You have to implement many methods. Here's an example

public class DreemMembershipProvider : MembershipProvider
{
...
   public override MembershipUser CreateUser(string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, out MembershipCreateStatus status)
   {
       //your code to insert a user in the db.
   }

   public override bool ValidateUser(string username, string password)
   {
         //your code to check the user and pass against your db 
   }
   ...
}

      



Finally, you need to configure your application to use the membership provider -> in your web.config file

0


a source







All Articles