Updating in memory datatable efficiently.

  • Thread starter Thread starter jensen bredal
  • Start date Start date
J

jensen bredal

Hello,

I have an asp.net app . I load a huge table from database in a datatable
object which is
cached. The source table is modified once an hour. I want my "in memory"
table to reflect these changes without reloading everything.( In fact , only
a few rows are added , substracted to the table).

How do i best update my "in memory" table without reloading the whole source
table. That should be far more efficient then having to pull the entire
table again.

Many thanks
JB
 
You could have something like an updated date allowing to reload only those
who changed...


Patrice
 
If you have an "updated" DateTime field in your source table you'll be able
:
- to retrieve which records have been updated (and if no records you can
stop here) since the last fetch
- to delete those records from your current datatable
- to insert those updated records in your current datatable

This way it should be possible to keep in sync by just reading from the
source those records who have been updated since the last read...


Patrice
 
- to retrieve which records have been updated (and if no records you can
stop here) since the last fetch
- to delete those records from your current datatable
- to insert those updated records in your current datatable

This way it should be possible to keep in sync by just reading from the
source those records who have been updated since the last read...


Patrice

That was much better!

Many thanks.

JB
 
Back
Top