The method 'OrderBy' must be called before the method 'Skip' Exception

后端 未结 2 1361
南笙
南笙 2021-02-08 04:58

I was trying to implement the jQgrid using MvcjQgrid and i got this exception.

System.NotSupportedException was unhandled by user code         


        
2条回答
  •  时光说笑
    2021-02-08 05:59

    I had the same type of problem after sorting using some code from Adam Anderson that accepted a generic sort string in OrderBy.

    After getting this excpetion, i did lots of research and found that very clever fix:

    var query = SelectOrders(companyNo, sortExpression);
    
    return Queryable.Skip(query, iStartRow).Take(iPageSize).ToList();
    

    Hope that helps !

    SP

提交回复
热议问题