Yes, in this scenario you will need to fill the whole DataTable.
If you dont want to populate the whole datatable, then use my second option.
i.e. fetch only certain number of records each time.
e.g. if you have a table called MyTable and a PK field called ID which runs
from say 10000 to 12000 AND you want to show only 100 records each time
then,
iMin = 10000
iMax = 10100
SQL = "select * from MyTable where ID >= " & iMin & " and ID <= " & iMax
'Fill the datatable using this statement
'Now when you want show the next page
iMin = iMin + 100
iMax = iMax + 100
SQL = "select * from MyTable where ID >= " & iMin & " and ID <= " & iMax
'Fill the datatable using this statement
Hope this helps
- Prateek
"Tim Marsden" <TM@UK.COM> wrote in message
news:Ow******** ******@TK2MSFTN GP11.phx.gbl...
Hi
Thanks for the response,
I only want to fetch the minimal amount of data from the database. Is it the
case with ADO that I have to populate the whole of the datatable before
applying the filter?. This defeats the object of trying to improve
performance.
Tim.
"Tian Min Huang" <ti******@onlin e.microsoft.com > wrote in message
news:ft******** ******@cpmsftng xa07.phx.gbl...
Hi Tim,
I agree with Prateek that you can filter the records. In ADO.NET, you can
use the DataView.RowFil ter property and the DataTable.Selec t method to
filter a subset of records. Please refer to the following articles and
samples for detailed information on this subject:
Filtering and Sorting in ADO.NET
http://www.akadia.com/services/dotnet_filter_sort.html
HOW TO: Perform a Complex Filter in ADO.NET
http://support.microsoft.com/?id=321896
Please feel free to let me know if you have any problems or concerns.
Regards,
HuangTM
Microsoft Online Partner Support
MCSE/MCSD
Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.