0

I have an enter image description hereexisiting database which I used to create a Model usign the Database first approach. Please refer to the database diagram.

In my solution file, I have a Class Library of the model which has an ADO.NET connection to the database & and I a ASP.NET MVC 3 web application.

The funcitonality that I'm trying to get here is that - the information displayed once a user logs in is different for every user. How do I link the user login page to the 'user' table of the database? Is it directly using the connection string or do I need to go through the model that I created using the Database?

1 Answer 1

1

Add a field to your User table called "ProviderUserKey" or MembershipUserID, or something similar of type uniqueidentifier. You then call Membership.GetUser().ProviderUserKey and use that in your where clause of your User Table to select the correct User record based on the logged in user.

Sign up to request clarification or add additional context in comments.

6 Comments

That is right, but how do I link the user login view with this user table for user authentication?
@mvador99 - I don't understand. What does your table have to do with user authentication? Authentication is handled by the Membership system, and has nothing to do with your table. Or do you mean you want to use your table instead of the asp.net membership tables? If that's the case, then you need to write a custom membership provider.
Yes I want to use the User table instead of the Membership tables. What do you mean by a custom membership provider?
@mvador99 - I mean, create a custom membership provider. msdn.microsoft.com/en-us/library/ie/f1kyba5e.aspx
Can I use the regular Membership provider and then use the User table to store additional information? If yes, will that allow me to filter the SalesOrders and other records by user?
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.