hello,
i am using sqlcachedependency in asp.net 2.0. when my database table is changed cache should be invalidate but ist not working. cache holds data as it is. i have enable service broker also grant permission, but invalidation not working. my code is as follow...
private void filldtview()
{
Dataview dv = (DataView)Cache.Get("spGetUsers");
if (dv == null)
{
Hashtable ht = new Hashtable();
cmd = (SqlCommand)objgetcmd.GetCommand("dbo.spGetUsers", CommandType.StoredProcedure, ht);
SqlCacheDependency dpndency = new SqlCacheDependency(cmd);
dv = FilterDataView(UserCache.UserView, ar);
Cache.Insert("spGetUsers", dv, dpndency);
}
}
here command from another class file in same project
hash table is need in this getcommand method. so there is no error to access command. first time execute this code but then cache never invalidate .
sqldependency.start(connectionstring);
this is set to globle. asax page.
also cachedependency configure in web.config file.
so please... help me to fix this error...