Personally, I used the timestamp method before, and it works well - it makes caching more efficient, only getting data that has changed since the last read.
As an alternative, I would suggest the SqlCacheDependency class, which will take care of updating the cache. I can not comment on any real pluses + minuses of this, or a performance comparison compared to a timestamp, since I did not use it myself.
Here is another useful article about SqlCacheDependency here
Update: Yes, I donโt think it really will update the data. It looks like you have to do it yourself. From the second link:
When data changes - and only then - cache elements, based on this data are canceled and removed from the cache. At the next request, this item is from the cache, if it is not in the cache, you can re-add the upgrade version to the cache and assured that you have the latest data
It also mentions special notes on SQL 2005 implementation in the 2nd link:
SQL Server 2005 controls changes to the result set for a particular SQL command. If a change occurs in a database that will change the results of the set of this command, the dependency causes the cached item to be invalidated. This allows SQL Server 2005 to provide a number of levels of notification.
I personally think that I will be suitable for a time-stamped approach (this is what I did before), since I do not see at first glance that SqlCacheDependency will give any performance advantages - I think it will be less efficient (just easier to implement). One day I will turn around to actually try SqlCacheDependency to do the right performance analysis :)
Update 2: Regarding merging new data into existing data, I think the Merge method is for the data you want.
The Merge method is used to combine two DataTable objects, which have basically similar schemes. Merging is typically used in a client application to incorporate the latest changes from a data source into an existing DataTable.
...
...
When combining a new DataTable source into a target, any source rows with a DataRowState Unchanged, Modified, or Deleted value are mapped to target rows with the same primary key value. Source rows with an added DataRowState value are added to new target rows with the same primary key values โโas the new source rows.
You just need to make sure that you define the column (s) in the datatable, which are the primary key.