Search code examples
asp.netpaginationsql-server-2000

Server Error due to paging issue


I think I sorted out my GridView1_PageIndexChanged event and thinking it should work

 protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
    GridView1.DataSourceID = "lqPackWeights";
    GridView1.PageIndex = e.NewPageIndex;
}

However, when I now attempt to access page 2 of x, I receive the following:

Server Error in '/project' application. This provider supports Skip() only over ordered queries returning entities or projections that contain all identity columns, where the query is a single-table (non-join) query, or is a Distinct, Except, Intersect, or Union (not Concat) operation.

I'm a bit confused by this, I'm not using skip as far as I can see unless I am going blind?

I am currently using SQL2000, is this a problem directly related to this instance of SQL?


Solution

  • Are you using LINQ to SQL? The problem seems unique to SQL Server 2000. See these MSDN articles on Troubleshooting (LINQ to SQL) and Standard Query Operator Translation (LINQ to SQL) for more information.

    EDIT

    A similiar question has been asked before, see: LINQ, Skip, OrderBy, and SQL Server 2000