membership provider 2 user tables
i have a database with a teacher table and student table.
both are types of user. i plan to allow teacers and students to register/login
i'm doing this in asp.net and so would like to use the provide model (writing custom membership provider).
My question is how can i create a custom membership provider when there are 2 user tables instead of one? can i have two membership providers defined in the web.config?
thinking one step ahead i would imagine someone will suggest combining the teacher and student tables into one user table and have a usertype lookup table to define the type of user. This is possible i guess but there
are a couple of things that are stopping me from doing that.
1) whilst the teacher and student table share a lopt fo the same fields (forename, surname, address, contact number), there is also a lot they don't share and im not sure its a good idea to have a table half full with null values.
2) There are a lot of relationships coming off both tables, combining the two tables together would mean at least 10 tables would hang off the one user table
I don't know whther 1) and 2) are valid reasons for not combining the two tables. if anyone could give me some pointers i'd be most grateful.
Re: membership provider 2 user tables
#1 is not a valid reason. A basic 'members' table would have, simply... username, password and type. (Type = student or teacher).
The rest of the details for these users can be in separate tables. If type = 1, then you'd look at table 'Student', else you'd look at table 'Teacher'. (Your stored procs queries would be based upon the value of type of course).
2. That's quite alright. :)