Click here to Skip to main content
15,887,821 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a data set storing all continents with their respective countries. I am caching the data table:

C#
DataSet dset = new DataSet();
string cacheKey = "CoverageDataTable";
object cacheItem = Cache[cacheKey] as DataTable;
if (cacheItem == null)
{
    dset = (DataSet)_obj.GetAllContinent();
    cacheItem = dset.Tables[0];
    Cache.Insert(cacheKey, cacheItem, null, System.Web.Caching.Cache.NoAbsoluteExpiration, TimeSpan.FromHours(5), CacheItemPriority.High, null);
 }


Now I want that if there is any change in the data table, fresh data should be fetched from the database. How can I do this?
Posted

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900