[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.caching

Newbie sql dependency cache question

LetoLtd

11/22/2006 1:48:00 PM

Just checking this is the right approach for my application.

I have business layer which is called from my aspx and gets a list of
countries via a stored procedure(in the data layer) this List is then
put into a dropdown. In order to implement the sql cache for this do I
need to simply pass in a reference to the httpcontext.cache to my
business layer, check to see if the list is nothing and if so do:

Sub AddCountriesToCache(cache as Cache,listofcountriesd as IList)
dim sqldep as SqlCacheDependency = new SqlCacheDependency("xyz",
"Country")
cache.Insert("CountryList",listofcountries,
sqldep,datetime.now.adddays(1),Cache.NoSlidingExpiration)
End Sub

and this will then all be handled by SQL Server(which has been setup
for the cache etc). Am I right in thinking the ouputCache is only used
for specific tables used on the aspx

Thanks