kitw
kitw

Reputation: 323

Mvc controller on LINQ-to-SQL models

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

enter image description here

the result after clicking "Add" return Unsupported context type.

Upvotes: 1

Views: 5185

Answers (2)

RGR
RGR

Reputation: 1571

Check the below Scottgu's blog link. It may help you.

linq to sql

Upvotes: 1

Marcel Gosselin
Marcel Gosselin

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

Related Questions