473,387 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

Nov 19 '05 #1
2 1038
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" <as**@discussions.microsoft.com> wrote in message
news:66**********************************@microsof t.com...
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 & "') "

Nov 19 '05 #2
Have a look at this article
http://support.microsoft.com/default...b;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
"asad" <as**@discussions.microsoft.com> wrote in message
news:66**********************************@microsof t.com...
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 & "') "

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: VMI | last post by:
We have this huge application that's based on storing tons of data on a dataTable. The only problem we're having is that storing LOTS of data (1 million records) into a datatable will slow down the...
1
by: Andrew Banks | last post by:
I've added a data grid to my page but the automatic paging feature doesn't seem to be working. The code I have on page load is as follows. Can anyone suggest why this isn't working? ...
2
by: Joe Au | last post by:
I enable paging on a data grid. But when I click on the page number, nothing happen. Do I have to code something to handle it? Thanks.
4
by: Patrick.O.Ige | last post by:
When i try to do paging in Datagrid why do i get the error:- System.Web.HttpException: Cannot compute Count for a data source that does not implement ICollection.?
1
by: Not Me | last post by:
Hi, Very new to this, so apologies if I go completely wrong :) I'm wanting to create a link to a separate page based on data in a datagrid. I can get it working almost how I want it using a...
5
by: tshad | last post by:
Is there a way to carry data that I have already read from the datagrid from page to page? I am looking at my Datagrid that I page through and when the user says get the next page, I have to go...
3
by: Scottie_do | last post by:
I have a 20meg in-memory stack-based array and I'd like to normalise in the client's memory... then add foriegn keys, and display results on a datagrid. I discovered that converting the stack to a...
5
by: Donald Adams | last post by:
Hi, I will have both web and win clients and would like to page my data. I could not find out how the datagrid control does it's paging though I did find some sample code that says they do it...
1
by: =?Utf-8?B?TG95b2xhIHN0YWxpbg==?= | last post by:
Hi, I am using ASP.Net 2.0 version and Windows'XP OS. I am useing the Grid view control to display the user details along with the paging concept provided by the grid view control. When i...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.