Server Error in '/' Application.

Count must have a non-negative value.
Parameter name: count

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.ArgumentException: Count must have a non-negative value.
Parameter name: count

Source Error:


Line 234:        BrandsFilter.DataBind();
Line 235:        lvItems.DataSource = res;
Line 236:        lvItems.DataBind();
Line 237:        BackUrl.NavigateUrl = "~/ShopInfo/" + shop.Name.toClearStr() + "/" + shop.ShopID.ToString();
Line 238:        HitCount.InnerHtml = shop.Hit.ToString().ToPersianNumber();

Source File: c:\inetpub\wwwroot\digionline.ir\ShopItems.aspx.cs    Line: 236

Stack Trace:


[ArgumentException: Count must have a non-negative value.
Parameter name: count]
   System.Data.Common.CommandTrees.ExpressionBuilder.Internal.ArgumentValidation.ValidateSkip(DbExpressionBinding input, IEnumerable`1 sortOrder, DbExpression count) +369
   System.Data.Common.CommandTrees.ExpressionBuilder.DbExpressionBuilder.Skip(DbExpressionBinding input, IEnumerable`1 sortOrder, DbExpression count) +27
   System.Data.Objects.ELinq.ProjectSortLifter.Skip(DbExpression k) +27
   System.Data.Objects.ELinq.ExpressionConverter.Skip(DbExpressionBinding input, DbExpression skipCount) +34
   System.Data.Objects.ELinq.PagingTranslator.TranslateUnary(ExpressionConverter parent, DbExpression operand, MethodCallExpression call) +91
   System.Data.Objects.ELinq.MethodCallTranslator.TypedTranslate(ExpressionConverter parent, MethodCallExpression linq) +124
   System.Data.Objects.ELinq.ExpressionConverter.TranslateExpression(Expression linq) +130
   System.Data.Objects.ELinq.UnarySequenceMethodTranslator.Translate(ExpressionConverter parent, MethodCallExpression call) +154
   System.Data.Objects.ELinq.MethodCallTranslator.TypedTranslate(ExpressionConverter parent, MethodCallExpression linq) +124
   System.Data.Objects.ELinq.ExpressionConverter.TranslateExpression(Expression linq) +130
   System.Data.Objects.ELinq.ExpressionConverter.Convert() +21
   System.Data.Objects.ELinq.ELinqQueryState.GetExecutionPlan(Nullable`1 forMergeOption) +348
   System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption) +215
   System.Data.Objects.ObjectQuery`1.GetIListSourceListInternal() +30
   System.Web.UI.DataSourceHelper.GetResolvedDataSource(Object dataSource, String dataMember) +74
   System.Web.UI.WebControls.ReadOnlyDataSource.System.Web.UI.IDataSource.GetView(String viewName) +85
   System.Web.UI.WebControls.DataBoundControl.ConnectToDataSourceView() +392
   System.Web.UI.WebControls.DataBoundControl.GetData() +9
   System.Web.UI.WebControls.DataBoundControl.PerformSelect() +113
   System.Web.UI.WebControls.ListView.PerformSelect() +125
   ShopItems.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\digionline.ir\ShopItems.aspx.cs:236
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   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.4682.0