Many records in ADO.NET

  • Thread starter Thread starter Fire Garden
  • Start date Start date
F

Fire Garden

Hi !

Has anyone any idea how can I do paging with ADO.NET, or any other way.
I want to use it in a project that it has to load approx. 9000 records and
they would grown up.

Chris
 
Hi Fire,

If you are on Sql server or Access, use TOP directive with combination of
autoincrement key (WHERE Key >= xxx).
If you are on Oracle - there is RowNum field you can put in WHERE clause.
 
Ah, yes, there is also dataAdapter.Fill (dataset, first, count) method.
However, this is the slowest of all.
 
I try this solution but I figured out that the Fill Method returns in memory
all the records
from DB and then 'cut' the records I want.

I thought to make a class that it will managed paging without any more code
than the Max records at time.
What do you think about that. I also had a problem with Implement of
IDbDataAdapter.
 
Miha Markic said:
Hi Fire,

If you are on Sql server or Access, use TOP directive with combination of
autoincrement key (WHERE Key >= xxx).
If you are on Oracle - there is RowNum field you can put in WHERE clause.
 
Hi Fire,

As a point of information, unless the number and size of the cols in the
table are unusually large, loading 9000 rows is a piece of cake for ado
..net. Even up to 100,000 is fine, starting there to degrade somewhat.

Also, Component One have 'dataobjects' that can automatically page, but
didn't like the results, as it requires constant paging if within a
datagrid, etc.

HTH,

Bernie Yaeger
 
Hi Fire,

Fire Garden said:
I try this solution but I figured out that the Fill Method returns in memory
all the records
from DB and then 'cut' the records I want.

Actually not. It does the select and fetches only start+count records (not
all).
I thought to make a class that it will managed paging without any more code
than the Max records at time.
What do you think about that. I also had a problem with Implement of
IDbDataAdapter.

Probably the best way.
 
Bernie,

the loading of 9000 rows is taking about 7 second in a Pentium 2,8 GHz and
2GB RAM.
I want my program to have immediately reaction OnLoad.
On the other hand, I think, that is not usefull to load 9,000 or 100,000
rows at a time the most records
that can be viewed are approx 1000. There is no point to load the other
8,000 records. I end-user scrolls at the end of
datagrid you can load another resultset of 1,000 records.

Thats why I want to make a Component for manual paging. But, I do not know
which is the right way to do that.

Chris
 
Fire Garden said:
Hi !

Has anyone any idea how can I do paging with ADO.NET, or any other way.
I want to use it in a project that it has to load approx. 9000 records and
they would grown up.

The ".NET Data Access Architecture Guide" discusses paging approaches ito
some degree. Link at( watch for break ):

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/daag.asp

I didn't find any silver bullet in here, but useful nonethless!? Just out of
interest, is your paging required for GUI purposes?

Tobes
 
Back
Top