Custom MembershipProvider

G

Guest

Hi,

I am revamping my company's website using .Net 2.0 & C#. I would like to
implement my own custom membership provider to manage membership information
already stored in my existing SQL 2000 database.

Therefore, I need to create a class the inherits the MembershipProvider
abstract class from the System.Web.Security namespace. For instance, I need
to provide a method in this class for creating user as follows:

public override MembershipUser CreateUser(string username,
string password,
string email,
string passwordQuestion,
string passwordAnswer,
bool isApproved,
object providerUserKey,
out MembershipCreateStatus status)

My question is, what if I have different user info fields in my database? I
don't want to use the password question and answer, but I need to store the
address, phone number of a new user. Do I just create a just dummy method
required for the implementation, and then another overload with the fields
that I need?


Thanks,
WB.
 
J

John Murray

For fields like address and phone number, I suggest you look at also
implementing a profile provider (it's not that much more work.) For
remembering profile type information, you will find that it's probably
easier than trying to shoe-horn in additional information on the user
object itself. For the password question/answer stuff -- you can feel
free to ignore the values if you dont intend to use them.

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top