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'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NotSupportedException: The method 'Skip' is only supported for sorted input in LINQ to Entities. The method 'OrderBy' must be called before the method 'Skip'.

Source Error:


Line 432:            End If
Line 433:
Line 434:            results = (From qry In query
Line 435:   Select New ProductDetails With {
Line 436:          .Product = qry.prd,

Source File: \\hp3-winc2-smb1.hostingp3.local\domainsw\265\2124265\user\htdocs\App_Code\ProductDetails.vb    Line: 434

Stack Trace:


[NotSupportedException: The method 'Skip' is only supported for sorted input in LINQ to Entities. The method 'OrderBy' must be called before the method 'Skip'.]
   System.Data.Objects.ELinq.PassthroughOrderByLifter.Skip(DbExpression k) +60
   System.Data.Objects.ELinq.OrderByLifter.Skip(DbExpressionBinding input, DbExpression skipCount) +30
   System.Data.Objects.ELinq.ExpressionConverter.Skip(DbExpressionBinding input, DbExpression skipCount) +25
   System.Data.Objects.ELinq.SkipTranslator.TranslatePagingOperator(ExpressionConverter parent, DbExpression operand, DbExpression count) +41
   System.Data.Objects.ELinq.PagingTranslator.TranslateUnary(ExpressionConverter parent, DbExpression operand, MethodCallExpression call) +63
   System.Data.Objects.ELinq.UnarySequenceMethodTranslator.Translate(ExpressionConverter parent, MethodCallExpression call) +136
   System.Data.Objects.ELinq.SequenceMethodTranslator.Translate(ExpressionConverter parent, MethodCallExpression call, SequenceMethod sequenceMethod) +15
   System.Data.Objects.ELinq.MethodCallTranslator.TypedTranslate(ExpressionConverter parent, MethodCallExpression linq) +104
   System.Data.Objects.ELinq.TypedTranslator`1.Translate(ExpressionConverter parent, Expression linq) +50
   System.Data.Objects.ELinq.ExpressionConverter.TranslateExpression(Expression linq) +115
   System.Data.Objects.ELinq.UnarySequenceMethodTranslator.Translate(ExpressionConverter parent, MethodCallExpression call) +112
   System.Data.Objects.ELinq.SequenceMethodTranslator.Translate(ExpressionConverter parent, MethodCallExpression call, SequenceMethod sequenceMethod) +15
   System.Data.Objects.ELinq.MethodCallTranslator.TypedTranslate(ExpressionConverter parent, MethodCallExpression linq) +104
   System.Data.Objects.ELinq.TypedTranslator`1.Translate(ExpressionConverter parent, Expression linq) +50
   System.Data.Objects.ELinq.ExpressionConverter.TranslateExpression(Expression linq) +115
   System.Data.Objects.ELinq.OneLambdaTranslator.Translate(ExpressionConverter parent, MethodCallExpression call, DbExpression& source, DbExpressionBinding& sourceBinding, DbExpression& lambda) +45
   System.Data.Objects.ELinq.SelectTranslator.Translate(ExpressionConverter parent, MethodCallExpression call) +37
   System.Data.Objects.ELinq.SequenceMethodTranslator.Translate(ExpressionConverter parent, MethodCallExpression call, SequenceMethod sequenceMethod) +15
   System.Data.Objects.ELinq.MethodCallTranslator.TypedTranslate(ExpressionConverter parent, MethodCallExpression linq) +104
   System.Data.Objects.ELinq.TypedTranslator`1.Translate(ExpressionConverter parent, Expression linq) +50
   System.Data.Objects.ELinq.ExpressionConverter.TranslateExpression(Expression linq) +115
   System.Data.Objects.ELinq.ExpressionConverter.Convert() +17
   System.Data.Objects.ELinq.ELinqQueryState.GetExecutionPlan(Nullable`1 forMergeOption) +266
   System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption) +135
   System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator() +37
   System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +174
   System.Linq.Enumerable.ToList(IEnumerable`1 source) +61
   ProductDetails.GetProductDetails(clsCustomerAccountDetails& c, ProductSearchWO WO, Int32 ProductsPerPage, Boolean GetRandomResult, Boolean GetQueryCount, Boolean NoTracking) in \\hp3-winc2-smb1.hostingp3.local\domainsw\265\2124265\user\htdocs\App_Code\ProductDetails.vb:434
   ProductDetails.GetProductDetails(ProductSearchWO WO, Int32 ProductsPerPage, Boolean GetRandomResult, Boolean GetQueryCount, Boolean NoTracking) in \\hp3-winc2-smb1.hostingp3.local\domainsw\265\2124265\user\htdocs\App_Code\ProductDetails.vb:300
   MTMHelperFunction.MTMReturnProductResults(Page Page, Int32 ProductsPerPage, Boolean GetQueryCount, Int64 Level1ID, Int64 Level2ID, Boolean GetRandomResult, Boolean NoTracking) in \\hp3-winc2-smb1.hostingp3.local\domainsw\265\2124265\user\htdocs\App_Code\MTMHelperFunction.vb:651
   MTM_MTMRepeater.LoadProductsItemData() in \\hp3-winc2-smb1.hostingp3.local\domainsw\265\2124265\user\htdocs\MTM\MTMRepeater.ascx.vb:528
   MTM_MTMRepeater.Page_Load(Object sender, EventArgs e) in \\hp3-winc2-smb1.hostingp3.local\domainsw\265\2124265\user\htdocs\MTM\MTMRepeater.ascx.vb:274
   System.Web.UI.Control.OnLoad(EventArgs e) +97
   System.Web.UI.Control.LoadRecursive() +61
   System.Web.UI.Control.LoadRecursive() +134
   System.Web.UI.Control.LoadRecursive() +134
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +693


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4700.0