Groups | Blog | Home
all groups > asp.net > may 2005 >

asp.net : Data grid paging Error


asad
5/7/2005 11:48:03 PM
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 CurrentPageIndex value. It must be >= 0 and < the PageCount
below is my query to fetch data from database

Dim sqlq as string
sqlq="SELECT softwarehouse,address,phone,URL from softhouse where cityID=
('" & c & "') "
Alvin Bruney [MVP - ASP.NET]
5/8/2005 10:12:03 AM
Have a look at this article
http://support.microsoft.com/default.aspx?scid=kb;en-us;555074

--
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
[quoted text, click to view]

Yunus Emre ALPÖZEN [MCAD.NET]
5/8/2005 12:01:36 PM
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

[quoted text, click to view]

AddThis Social Bookmark Button