🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.delphi.aspdotnet.components.using
Article #23

Re: D2005 Datagrid paging

#23
From: James D. Franchello
Date: Mon, 08 Jan 2007 19:59
65 lines
3504 bytes
Hello Bob,

I managed to get it to work but what I had to do was the following:

      DataSet1.Dispose;
      DataSet1 := Dataset.Create;
      lItemCount := daRequests.Fill(Dataset1);

which seems really inefficient since it implies that on each Pageindex
change I go and get all the data again. I guess I just don't understand
these objects because it seemed to me that once I had used the Fill() the
data should be available in the dataset so that any requests such as for a
different page index would simply use whatever was in the dataset at the
time the request was made.

I am not using the BDP objects but rather the OLEDB objects. Is there any
particular reason to use one over the other?

I will check the reference you posted - thank you for that! And I would also
like to offer a general thanks to you for your generosity in giving your
time and sharing your knowledge in these group postings! I have learned a
lot from many of your answers to others and postings and I can't thank you
enough for that!!!

James


"Bob Swart" <b.swart@chello.nl> wrote in message
news:45A0CBC6.4090602@chello.nl...
> Hi James,
>
> > I am trying to use a datagrid control and enable paging. No matter what
I do I get the following errror:
> > Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount.
> > even though if I step through and debug I see that the pageindex I am
attempting to set (1) is less than the page count (2).
>
> But when you call DataBind on the DataGrid again, does the DataGrid's
> DataSource still contain the data? Did you re-execute the query, or
> obtain the data from a cache (like the session for example?).
>
> Note that if you use BdpDataAdapter, then leaving the Active property
> set to True will do the trick (it's not as efficient as storing the
> result in the session, but at least ensures the query will always be
> re-executed).
>
> > I have searched for this message in the newsgroups and cannot find any
answer that applies. Has anyone had this problem and been able to resolve
it?
>
> See
>
http://www-128.ibm.com/developerworks/db2/library/techarticle/dm-0401swart/
> for an example how to do it using BdpDataAdapter.
>
> > Thanks,
> > James
>
> Groetjes,
>            Bob Swart
>
> -- 
> Bob Swart Training & Consultancy (eBob42.com)  Forever Loyal to Delphi
> Blog: http://www.drbob42.com/blog - RSS: http://drbob42.com/weblog.xml
> New Delphi 2006 Courseware e-books at http://www.eBob42.com/courseware
Technical Details
Message-ID: <45a2a1ad@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <459d2f1e$1@newsgroups.borland.com> <45A0CBC6.4090602@chello.nl>

Show Full Headers
Complete Article Headers
X-Google-Thread: 21665a,5bca6ea60c26735f
X-Google-Attributes: gid21665a,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "James D. Franchello" <james@nospam_INTInfo.com>
Newsgroups: borland.public.delphi.aspdotnet.components.using
References: <459d2f1e$1@newsgroups.borland.com> <45A0CBC6.4090602@chello.nl>
Subject: Re: D2005 Datagrid paging 
Date: Mon, 8 Jan 2007 14:59:00 -0500
Lines: 67
Organization: INT Information Systems, Inc.
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
NNTP-Posting-Host: 76.181.83.231
Message-ID: <45a2a1ad@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1168286125 76.181.83.231 (8 Jan 2007 11:55:25 -0800)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail