Server Error in '/' Application.

Specified argument was out of the range of valid values.
Parameter name: takeCount

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.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: takeCount

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:


[ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: takeCount]
   System.Data.Linq.SqlClient.QueryConverter.VisitTake(Expression sequence, Expression count) +730
   System.Data.Linq.SqlClient.QueryConverter.VisitInner(Expression node) +889
   System.Data.Linq.SqlClient.QueryConverter.VisitOrderBy(Expression sequence, LambdaExpression expression, SqlOrderType orderType) +132
   System.Data.Linq.SqlClient.QueryConverter.VisitInner(Expression node) +889
   System.Data.Linq.SqlClient.QueryConverter.VisitTake(Expression sequence, Expression count) +623
   System.Data.Linq.SqlClient.QueryConverter.VisitInner(Expression node) +889
   System.Data.Linq.SqlClient.QueryConverter.ConvertOuter(Expression node) +131
   System.Data.Linq.SqlClient.SqlProvider.BuildQuery(Expression query, SqlNodeAnnotations annotations) +166
   System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query) +162
   System.Data.Linq.DataQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator() +58
   System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +437
   System.Linq.Enumerable.ToList(IEnumerable`1 source) +69
   FootPro.Biz.ListaFoto(Int32 idNovita, Int32 itemsPerPage, Int32 pageNumber) in D:\repos\FootProNew\FootPro\Biz.cs:0

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
   System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +221
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +231
   System.Web.UI.WebControls.ObjectDataSourceView.InvokeMethod(ObjectDataSourceMethod method, Boolean disposeInstance, Object& instance) +910
   System.Web.UI.WebControls.ObjectDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1980
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +22
   System.Web.UI.WebControls.ListView.PerformSelect() +125
   FootPro.Web.New.Risultato.OnLoad(EventArgs e) in D:\repos\FootProNew\FootPro.Web.New\Risultato.aspx.cs:76
   System.Web.UI.Control.LoadRecursive() +154
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4082


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