Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Error al ir ultima pagina del gridview

74 views
Skip to first unread message

jfb...@hotmail.com

unread,
Jan 12, 2009, 1:25:21 PM1/12/09
to
Al tener este código,


<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AllowSorting="True"
AutoGenerateColumns="False"
DataKeyNames="idvehiculos" DataSourceID="ObjectDataSource1"
Width="552px" PageSize="8" EnableViewState="False" Height="144px">
<Columns>
..........
</Columns>
<RowStyle CssClass="gridfilas" />
<HeaderStyle CssClass="gridcabecera"
ForeColor="White" />
<PagerStyle CssClass="gridcabecera"
ForeColor="White" HorizontalAlign="Center" />
<PagerSettings Mode="NumericFirstLast" />
</asp:GridView>


¿por que sólo me da este error al ir a la ultima página?

La operación aritmética ha provocado un desbordamiento.
Descripción: Excepción no controlada al ejecutar la solicitud Web
actual. Revise el seguimiento de la pila para obtener más información
acerca del error y dónde se originó en el código.

Detalles de la excepción: System.OverflowException: La operación
aritmética ha provocado un desbordamiento.

Error de código fuente:

Se ha generado una excepción no controlada durante la ejecución de la
solicitud Web actual. La información sobre el origen y la ubicación de
la excepción pueden identificarse utilizando la excepción del
seguimiento de la pila siguiente.

Seguimiento de la pila:


[OverflowException: La operación aritmética ha provocado un
desbordamiento.]
System.Web.UI.WebControls.GridView.CreateDataSourceSelectArguments
() +310
System.Web.UI.WebControls.DataBoundControl.PerformSelect() +82
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +99
System.Web.UI.WebControls.GridView.DataBind() +23
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound()
+92

System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls
() +100
System.Web.UI.Control.EnsureChildControls() +134
System.Web.UI.Control.PreRenderRecursiveInternal() +109
System.Web.UI.Control.PreRenderRecursiveInternal() +233
System.Web.UI.Control.PreRenderRecursiveInternal() +233
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+4437


sergiotarrillo

unread,
Jan 16, 2009, 12:32:01 AM1/16/09
to
Holas,

Lo que pasa es que has deshabilitado el ViewState, la explicación la da
Scott Mitchell en este foro: http://forums.asp.net/p/989032/1280574.aspx:

"Clicking the last page link causes a postback and instructs the GridView to
update its PageIndex property. If the last page link is clicked, the GridView
assigns its PageIndex property to a value one less than its PageCount
property. With view state disabled, the PageCount value is lost across
postbacks and the PageIndex is assigned the maximum integer value instead.
Next, the GridView attempts to determine the starting row index by
multiplying the PageSize and PageCount properties. This results in an
OverflowException since the product exceeds the maximum allowed integer size."

Saludos,

--
SergioTarrillo - http://sergiot2.com/blog

jfb...@hotmail.com

unread,
Jan 21, 2009, 5:21:39 PM1/21/09
to
pues ahora ya si funciona....no sabia yo que con esa propiedad se
pudiera solucionar....


Muchas Gracias,


On 16 ene, 06:32, sergiotarrillo


<sergiotarri...@discussions.microsoft.com> wrote:
> Holas,
>
> Lo que pasa es que has deshabilitado el ViewState, la explicación la da
> Scott Mitchell en este foro:http://forums.asp.net/p/989032/1280574.aspx:
>
> "Clicking the last page link causes a postback and instructs the GridView to
> update its PageIndex property. If the last page link is clicked, the GridView
> assigns its PageIndex property to a value one less than its PageCount
> property. With view state disabled, the PageCount value is lost across
> postbacks and the PageIndex is assigned the maximum integer value instead.
> Next, the GridView attempts to determine the starting row index by
> multiplying the PageSize and PageCount properties. This results in an
> OverflowException since the product exceeds the maximum allowed integer size."
>
> Saludos,
>
> --
> SergioTarrillo -http://sergiot2.com/blog
>

0 new messages