views:

210

answers:

3

İ try to work Ado.net Entity Framework with dynamic Data web Application But My solution run wthout error But Click gridview items create me :

Server Error in '/' Application. The method 'Skip' is only supported for sorted input in LINQ to Entities. The method 'OrderBy' must be called before the method 'Skip'.

A: 

At the risk of stating the obvious, perhaps you could locate the LINQ query in question, and change it so that OrderBy is called before Skip?

Robert Harvey
+1  A: 

Old question, but ran into this yesterday, so I thought posting the solution would make sense: this error occurs if you have selected the wrong template in Visual Studio for your dynamic data project. There are 2 templates (actually 4, 2 for websites and 2 for web projects):

  1. Dynamic data web application
  2. Dynamic data entities web application

Use 1 with linq-to-sql, use 2 with Entity Framework. If you use the first template with EF, you get the aforementioned error.

tijmenvdk
A: 

Thanks.

  1. Dynamic data web application
  2. Dynamic data entities web application

Use 1 with linq-to-sql, use 2 with Entity Framework. If you use the first template with EF, you get the aforementioned error.

This is the correct way to do it.