Data grid paging Error

G

Guest

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 & "') "
 
Y

Yunus Emre ALPÖZEN [MCAD.NET]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top