DataAdapter nrebiew Question

Hello guys,

One simple question:


DbDataAdapter adapter = objFactory.CreateDataAdapter();
adapter.Fill(ds, 0, 10, "tbl");
/*
is it okay to get limited records using this method? 
i.e. by filling dataset using adapter and providing min and max record limit?
I wish to do custom pagination using this method.
shall I go ahead?
what do you think?
*/

Please read comments

Thanks in advance.

I have never done paging like that before. I would suggest using something like Linq2Sql for paging. You can use the .Paginate() method to do the paging, and it will generate the correctly T-SQL query

I would do it in the sql select statement.
You will be reading more data then you need.

Is there’s any issue doing it this way?

The issue is that you will be reading more data than you need.
The more records you have the worst.
Say you have 500 records and you are displaying 20 per request. At the first page you will be reading 20 records and displaying 20, second page you read 40 and display 20, at the last page (25) you will be reading 500 records and only displaing 20.

What is the best way to tackle it?

I am using Oracle 10g and using System.Data.OracleClient

Can anyone please tell me the easiest way?

How about pagedDataSource? This also has same problem?

Thank you for the response.

my knowledge of PL/SQL is limited… (same as none)
I found this link with an example of a select for oracle http://awads.net/wp/2005/07/22/paging-through-a-query-result/