Server Error in '/' Application.

Non-static method requires a target.

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.Reflection.TargetException: Non-static method requires a target.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[TargetException: Non-static method requires a target.]
   System.Reflection.RuntimeMethodInfo.CheckConsistency(Object target) +14768697
   System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +154
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +96
   System.Reflection.RuntimePropertyInfo.GetValue(Object obj, Object[] index) +34
   Telerik.OpenAccess.Query.LinqExecutor.GetValues(String[] name, Object[] groupResolutionParamValues, ExpressionCompiler compiler) +436
   Telerik.OpenAccess.Query.ExpressionCompiler.PerformDatabaseQueryImpl(Type resultType, Int32 elementAt, Object[] groupResolutionParamValues, Boolean single, Boolean checkOid) +1761
   Telerik.OpenAccess.Query.ExpressionCompiler.PerformDatabaseQuery(Type type, Int32 elementAt, Object[] groupResolutionParamValues, Boolean single, Boolean checkOid) +50

[InvalidOperationException: An exception occurred during the execution of 'Extent<DataAccessModel.Prodottitaglie>().Where(o => ((o.IDPRODOTTO == value(Progetto.Prodotto+_Closure$__1).$VB$Local_prodotto.IDPRODOTTO) And (o.DISPONIBILE == -1))).OrderBy(p => p.POSIZIONE).Count()'. Failure: Non-static method requires a target.
See InnerException for more details.
Complete Expression:
.Call System.Linq.Queryable.Count(.Call System.Linq.Queryable.OrderBy(
        .Call System.Linq.Queryable.Where(
            .Constant<Telerik.OpenAccess.Query.ExtentQueryImpl`1[DataAccessModel.Prodottitaglie]>(Extent<DataAccessModel.Prodottitaglie>()),
            '(.Lambda #Lambda1<System.Func`2[DataAccessModel.Prodottitaglie,System.Boolean]>)),
        '(.Lambda #Lambda2<System.Func`2[DataAccessModel.Prodottitaglie,System.Int32]>)))

.Lambda #Lambda1<System.Func`2[DataAccessModel.Prodottitaglie,System.Boolean]>(DataAccessModel.Prodottitaglie $o) {
    $o.IDPRODOTTO == (.Constant<Progetto.Prodotto+_Closure$__1>(Progetto.Prodotto+_Closure$__1).$VB$Local_prodotto).IDPRODOTTO &
    $o.DISPONIBILE == .Constant<System.Int16>(-1)
}

.Lambda #Lambda2<System.Func`2[DataAccessModel.Prodottitaglie,System.Int32]>(DataAccessModel.Prodottitaglie $p) {
    $p.POSIZIONE
}
]
   Telerik.OpenAccess.Query.ExpressionCompiler.PerformDatabaseQuery(Type type, Int32 elementAt, Object[] groupResolutionParamValues, Boolean single, Boolean checkOid) +566
   Telerik.OpenAccess.Query.ExpressionExecution.PerformDatabaseQuerySingle(ChainedContext context, Expression expression, QueryableCategory before, Int32& found, Int32 elemAt, Boolean single, Boolean diffType) +252
   Telerik.OpenAccess.Query.ExpressionExecution.PerformQuerySingle(ExpressionCutter cutter, MethodCallExpression mce, ChainedContext piece, QueryOptions options) +447
   Telerik.OpenAccess.Query.Piece`1.ExecuteSingle(Expression expression) +301
   Progetto.Prodotto.Page_Load(Object sender, EventArgs e) +2025
   System.Web.UI.Control.OnLoad(EventArgs e) +106
   System.Web.UI.Control.LoadRecursive() +68
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3785


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