Here’s a basic ADO.NET data access template with a SqlCacheDependency. Just wanted to post this for my future reference. public static DataSet GetData(long itemID) { DataSet ds = new DataSet(); string cacheKey = Helpers.GetCacheKey(itemID); //Get a cache key unique to this method. if (HttpContext.Current.Cache[cacheKey] != null) { ds = (DataSet)HttpContext.Current.Cache[cacheKey]; } else { using (SqlConnection [...]
Tags: ado.net, bestpractice