Simon,
Suppose we have 100 thousand records in a datagrid, you
just click next page of data grid and it go get those
100 thousand records again, bind them, and take you
to next page.
what we did we cached datatable in an application object,
and bound it with data grid, and refreshed application object
on every insert/update/delete.
heres some code I used to load datatable for the first time,
or if it is already loaded, use from cache:
If context.Application("dvInvoices") Is Nothing Then
Dim dtTemp As DataTable = daoDgrCache.InvoicesSelectAll '// get
datatable from database
context.Application.Lock()
context.Application("dtInvoices") = dtTemp '// caches invoices datatable
context.Application.UnLock()
End If
datagrid1.DataSource = CType(context.Application("dtInvoices"),
DataTable).Copy.DefaultView
and on invoice record insert/update/delete, I called a proc
to refresh cache by doing this:
Dim dtTemp As DataTable = daoDgrCache.InvoicesSelectAll '// get datatable
from database
context.Application.Lock()
context.Application("dtInvoices") = dtTemp '// caches invoices datatable
context.Application.UnLock()
You can also use per-session caching and file caching.