How to invalidate a single data item in the .net cache in VB?

Taking an item out of the cache is as simple as calling HttpContext.Current.Cache. Remove(Key) so in your case you'd probably want.

Taking an item out of the cache is as simple as calling HttpContext.Current.Cache. Remove(Key) so in your case you'd probably want: Public Shared Sub CacheRemove(ByVal key As String) Dim userID As String = HttpContext.Current.User.Identity. Name HttpContext.Current.Cache.

Remove(Key & "_" & UserID) End Sub Since you say that when the data is updated you want the cached item to be removed so it gets re-cached with the updated data, you might want to take a look at using a SqlCacheDependency object. This wires up the cache to your database so that when your data changes, the cached item is automatically updated to keep it in sync.

Thanks for the CacheRemove pointer, That's worked nicely. I'm working away from the office so don't have my usual references nor Google-Foo. – Craig Jun 3 '10 at 13:51.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions