Data grid paging Error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • asad

    Data grid paging Error

    Hello i'm using ASP.NET Datagrid paging but i found and error if i forward to
    next page
    following errror occur pls tell me to get rid of this error,Thanks.

    " Invalid CurrentPageInde x value. It must be >= 0 and < the PageCount
    below is my query to fetch data from database

    Dim sqlq as string
    sqlq="SELECT softwarehouse,a ddress,phone,UR L from softhouse where cityID=
    ('" & c & "') "

  • Yunus Emre ALPÖZEN [MCAD.NET]

    #2
    Re: Data grid paging Error

    In fact, error is clear. Suppose that, your datagrid has a pagesize at 20.
    You have 100 rows means five pages. And you are viewing 4th page. than u
    change datasource in some way by refetching data or filtering data. And now
    your datasource contains 25 rows which means there is no 4th page.It is a
    common problem in .NET framework 1.1. But it is fixed with 2.0
    My advice u after refreshing datasource set current page index to first
    page.


    --

    Thanks,
    Yunus Emre ALPÖZEN
    BSc, MCAD.NET

    "asad" <asad@discussio ns.microsoft.co m> wrote in message
    news:666E00BE-18F4-458F-92AB-1A0768D5B54D@mi crosoft.com...[color=blue]
    > Hello i'm using ASP.NET Datagrid paging but i found and error if i forward
    > to
    > next page
    > following errror occur pls tell me to get rid of this error,Thanks.
    >
    > " Invalid CurrentPageInde x value. It must be >= 0 and < the PageCount
    > below is my query to fetch data from database
    >
    > Dim sqlq as string
    > sqlq="SELECT softwarehouse,a ddress,phone,UR L from softhouse where cityID=
    > ('" & c & "') "
    >[/color]


    Comment

    • Alvin Bruney [MVP - ASP.NET]

      #3
      Re: Data grid paging Error

      Have a look at this article


      --
      Regards,
      Alvin Bruney - ASP.NET MVP

      [Shameless Author Plug]
      The Microsoft Office Web Components Black Book with .NET
      Now available @ www.lulu.com/owc, Amazon.com etc
      "asad" <asad@discussio ns.microsoft.co m> wrote in message
      news:666E00BE-18F4-458F-92AB-1A0768D5B54D@mi crosoft.com...[color=blue]
      > Hello i'm using ASP.NET Datagrid paging but i found and error if i forward
      > to
      > next page
      > following errror occur pls tell me to get rid of this error,Thanks.
      >
      > " Invalid CurrentPageInde x value. It must be >= 0 and < the PageCount
      > below is my query to fetch data from database
      >
      > Dim sqlq as string
      > sqlq="SELECT softwarehouse,a ddress,phone,UR L from softhouse where cityID=
      > ('" & c & "') "
      >[/color]


      Comment

      Working...