ASP.NET 4 Custom Membership Provider Tables
Now this might just be straightforward, but I can't seem to figure it out..
I have set up the Custom Membership provider, and gave it the proper connection stuff. What I know is that it connects to the correct database, but I know for sure that it doesn't look at the correct table.
How would I set it up to use a specific table? As the table already has users in them.
The table name is: members_info
.
the column names are: member___id(key), member_name, member__pwd, member_perm
member___id => Being the Key and the account name to login with
member_name => Being the users Name or Nickname
member__pwd => 10 chars long (for now)
member_perm => holds 1 of the following values: 0) User 1)Admin 2)Banned
now I know that the later one is to be setup by the Role Provider, and I'm sure once I know how to do the membership one that one is similar in some way.
So my question is, how do I point the Custom Membership Provider t开发者_JAVA百科o the table: members_info
and to use member___id
for username, members__pwd
for password (and possibly get member_name out to say: Welcome {member_name}! when they login).
Thanks in advance for any help you can provide!
===
Added info. Members__uid is the key value as it increases on each new entry.
===
Since you can't tell it to use a specific table
How can I set it up so, that it works with the tool provided in visual studio? (Website > ASP.net Configuration).
As it now says 0 users, on the security tab. I want to be able to manage the users through here too.
You don't tell "Use this table" to your membership provider. Instead you just implement methods, that will look for data in your table. You have to manually implement methods (from MembershipProvider interface) that will have access to db and will execute your logic (validation o users credentials for example) based on data from your table.
You an get more specific info in this question.
精彩评论