Paging Data

  • Thread starter Thread starter Jeff Haumesser
  • Start date Start date
J

Jeff Haumesser

Good Morning:

Oracle has a feature on a form that allows the user to Page through
large Recordsets at certain number of records at a time in a list or grid.
For instance, when the user wants to view ALL the records of a table or
view, the first chunk is Immediately displayed. As the user scrolls down or
pages down, the next chunks are displayed accordingly. Therefore, the
records are displayed almost instantaneasly, but only chunks at a time. It
doesn't have to wait for ALL the records to load into memory before
displaying them.

I would like to do essentilaly the same in VB .NET. I have a listbox or
datagrid. The user, at times, would like to browse all the records of a
table or query that will ultimately result in 70,000+ records. However, the
time to load these records is horrendous due to a narrow bandwidth
connection of some locations.
I am currently using a Stored Procedure to load these records into a
Dataset then setting the List Datasource to that Dataset table.

Does anyone have any ideas that would work along these lines?

Thankyou in advance,

Jeff
 
There are actually number of ways to handle this. One is to handle paging in
your stored procedure (which is, at least imho, the preffered way, using the
least resources). Another (one probably used in what you're describing) is a
server side cursor, so the client only receives data when it moves to the
next record, as oposed to having to load all data first.

Jerry
 
Does DotNet support Server Side cursors, and in what way would paging be
handled in a stored procedure? Would it be in the way the Select Statement
is structured, such as Select Top <n> Where .... ?
 
..Net doesn't support server side cursors, not yet. It's supposed to be
available in the next version (2.0?). And paging in a stored procedure is
done by a couple SELECT TOP statements, I can post a sample code here.

Jerry
 
I appreciate your attention to my posts. I think I have a clear picture of
what you're describing. However, how would that tie into the scrollbar of
the List or Datagrid displaying this data? How would I make the call to get
the next page as I'm scrolling up or down? I noticed that the ASP.Net
Datagrid has this functionality built into it, yet the Windows Datagrid does
not. I may be going against Microsofts paradigm, but this is what I've been
asked to do.

Jeff
 
Correction! ASP .Net control doesn't have the scrolling functionality. I
stand corrected. However, my question still stands.
 
You will have to handle that yourself. I've never coded a WinForms
application, in Win32 API you just handle the scroll bar messages and pull
in data as needed. I'm assuming there are events that are called when the
grid is scrolled, just put your data pulling code in there.

Jerry
 
Back
Top