Posts Tagged ‘ado.net’

October 4, 2008 0

ADO.NET Data Access Template

By J in Uncategorized

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)
[...]

Tags: ,