Reputation: 323
I am trying to learn linking db with asp.net mvc.
Following the instruction on MS tutorials trying to build a controller. right click on controller and add a controller, but the data-context pre built by LINQ-to-SQL in VSExpress does not fit, is there any tutorial shows how to build a connection between built db and asp.net mvc web page from zero to pros
the result after clicking "Add" return Unsupported context type.
Upvotes: 1
Views: 5185
Reputation: 4716
The templates of ASP.Net MVC use Entity Framework code first and not LINQ-to-SQL. You can either change to use Entity Framework or use new templates (I know somebody who did this but I don't know how).
Here is an example that uses Linq-to-SQL with ASP.Net MVC3 but it creates the classes manually, you would still need to create your own templates.
Upvotes: 2