Previous Next

Thread: cannot be invalidate cache

Last post 05-14-2008 8:02 AM by chetanthummar. 0 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (1 items)

Sort Posts:

  • 05-14-2008, 8:02 AM

    • chetanthummar
    • Not Ranked
    • Joined on 04-22-2008, 3:27 AM
    • Ahmedabad, india
    • Posts 6

    cannot be invalidate cache

     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... 

    chetan thummar
Page 1 of 1 (1 items)
Page view counter