Server Error in '/' Application.

The offset specified in a OFFSET clause may not be negative.

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.Data.SqlClient.SqlException: The offset specified in a OFFSET clause may not be negative.

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:


[SqlException (0x80131904): The offset specified in a OFFSET clause may not be negative.]
   System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +2567798
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +5982764
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +285
   System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +4349
   System.Data.SqlClient.SqlDataReader.TryHasMoreRows(Boolean& moreRows) +240
   System.Data.SqlClient.SqlDataReader.TryReadInternal(Boolean setTimeout, Boolean& more) +268
   System.Data.SqlClient.SqlDataReader.Read() +34
   NHibernate.Driver.NHybridDataReader.Read() +14
   NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies, IResultTransformer forcedResultTransformer) +1038
   NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies, IResultTransformer forcedResultTransformer) +129
   NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters, IResultTransformer forcedResultTransformer) +139

[GenericADOException: could not execute query
[ select noticia0_.Id as Id97365_, noticia0_.Titulo as Titulo97365_, noticia0_.LinhaApoio as LinhaApoio97365_, noticia0_.Destaque as Destaque97365_, noticia0_.DataExpiracao as DataExpi6_97365_, noticia0_.DataPublicacao as DataPubl7_97365_, noticia0_.LegendaFotos as LegendaF8_97365_, noticia0_.CorFaixa as CorFaixa97365_, noticia0_.CorFonte as CorFonte97365_, noticia0_.ExibeIntranet as ExibeIn11_97365_, noticia0_.ExibePortal as ExibePo12_97365_, noticia0_.Tags as Tags97365_, noticia0_.IdCategoria as IdCateg14_97365_ from CdNoticia noticia0_ where dateadd(dd, 0, datediff(dd, 0, noticia0_.DataPublicacao))<=@p0 and noticia0_.ExibePortal=1 order by noticia0_.DataPublicacao desc OFFSET @p1 ROWS FETCH FIRST @p2 ROWS ONLY ]
  Name:p1 - Value:19/03/2024 00:00:00  Name:p2 - Value:-20  Name:p3 - Value:20
[SQL: select noticia0_.Id as Id97365_, noticia0_.Titulo as Titulo97365_, noticia0_.LinhaApoio as LinhaApoio97365_, noticia0_.Destaque as Destaque97365_, noticia0_.DataExpiracao as DataExpi6_97365_, noticia0_.DataPublicacao as DataPubl7_97365_, noticia0_.LegendaFotos as LegendaF8_97365_, noticia0_.CorFaixa as CorFaixa97365_, noticia0_.CorFonte as CorFonte97365_, noticia0_.ExibeIntranet as ExibeIn11_97365_, noticia0_.ExibePortal as ExibePo12_97365_, noticia0_.Tags as Tags97365_, noticia0_.IdCategoria as IdCateg14_97365_ from CdNoticia noticia0_ where dateadd(dd, 0, datediff(dd, 0, noticia0_.DataPublicacao))<=@p0 and noticia0_.ExibePortal=1 order by noticia0_.DataPublicacao desc OFFSET @p1 ROWS FETCH FIRST @p2 ROWS ONLY]]
   NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters, IResultTransformer forcedResultTransformer) +226
   NHibernate.Loader.Loader.ListIgnoreQueryCache(ISessionImplementor session, QueryParameters queryParameters) +20
   NHibernate.Loader.Loader.List(ISessionImplementor session, QueryParameters queryParameters, ISet`1 querySpaces, IType[] resultTypes) +79
   NHibernate.Loader.Hql.QueryLoader.List(ISessionImplementor session, QueryParameters queryParameters) +51
   NHibernate.Hql.Ast.ANTLR.QueryTranslatorImpl.List(ISessionImplementor session, QueryParameters queryParameters) +232
   NHibernate.Engine.Query.HQLQueryPlan.PerformList(QueryParameters queryParameters, ISessionImplementor session, IList results) +385
   NHibernate.Impl.SessionImpl.List(IQueryExpression queryExpression, QueryParameters queryParameters, IList results) +370
   NHibernate.Impl.AbstractSessionImpl.List(IQueryExpression queryExpression, QueryParameters parameters) +145
   NHibernate.Impl.AbstractQueryImpl2.List() +117
   NHibernate.Linq.DefaultQueryProvider.ExecuteQuery(NhLinqExpression nhLinqExpression, IQuery query, NhLinqExpression nhQuery) +36
   NHibernate.Linq.DefaultQueryProvider.Execute(Expression expression) +50
   NHibernate.Linq.DefaultQueryProvider.Execute(Expression expression) +37
   Remotion.Linq.QueryableBase`1.GetEnumerator() +53
   System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +375
   System.Linq.Enumerable.ToList(IEnumerable`1 source) +58
   WEB.PORTAL.Controllers.NoticiaController.Listagem(String tag, Int64 categoria, Int32 pagina) +171
   lambda_method(Closure , ControllerBase , Object[] ) +206
   System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +14
   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +182
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27
   System.Web.Mvc.Async.<>c__DisplayClass42.<BeginInvokeSynchronousActionMethod>b__41() +28
   System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +10
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +50
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +32
   System.Web.Mvc.Async.<>c__DisplayClass39.<BeginInvokeActionMethodWithFilters>b__33() +58
   System.Web.Mvc.Async.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() +228
   System.Web.Mvc.Async.<>c__DisplayClass37.<BeginInvokeActionMethodWithFilters>b__36(IAsyncResult asyncResult) +10
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +50
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +34
   System.Web.Mvc.Async.<>c__DisplayClass2a.<BeginInvokeAction>b__20() +24
   System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +99
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +50
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +27
   System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +14
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +16
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +50
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +38
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +16
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +50
   System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +28
   System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10
   System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +25
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +16
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +50
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +28
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9875173
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +48
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +159


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