Reputation: 3397
Building an MVC 3 app to work with an existing SQL Server 2012 database. The existing database has an existing UserProfile table with id, login, password and email.
I used this quick tutorial to get the nuget simplemembership pack working, and modified it to connect to my existing db and userprofile table. I received an error:
Unable to find the requested .Net Framework Data Provider
it is pointing to this line in the SimpleMembershipMvc3.cs file:
WebSecurity.InitializeDatabaseConnection(connectionStringName: "MyEntities", userTableName: "UserAccount", userIdColumn: "UserId", userNameColumn: "Login", autoCreateTables: false);
Apparently it is possible to get simplemembership working in an MVC3 DB First scenario, but all the articles I find online are either CodeFirst, or MVC4. I am looking for a complete tutorial for MVC3 DB First.
And I am not tied to SimpleMembership, I will try anything as long as it works. I tried making a custom SQLMembership Provider but could not get it to stop building its own, seperate database.
The only functionality I need to have is register, logon/off (all of which I already had, before I found out about the existence on membership and authentication), and I need to secure the members only pages of the site, which is why I started looking into all this in the first place.
Upvotes: 0
Views: 261
Reputation: 726
Try the following link which is specific to database first model of EF:
Using MVC 4 SimpleMembership with an existing database-first EF model
While it's specific to MVC4, it should be pretty similar to MVC3, and if not, then use the following two resources. The first one helps set up SimpleMembership with MVC3:
http://anderly.com/2011/08/11/using-simplemembership-in-mvc3/
This second link, just explains how to upgrade to MVC4 as another alternative to follow, and then reference the very first hyperlink I provided at the top.
http://www.asp.net/whitepapers/mvc4-release-notes#_Toc303253806
Upvotes: 1