[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

sqldatasource cache expiration

Brian

10/24/2007 5:01:00 PM

I have an sqldatasource bound to a gridview control. I have caching enabled
(60 seconds). I have enabled sorting on the gridview and when I select the
column everything works as expected. The data is retrieved from the cache and
never goes back to the database. However, if the user wants to perform
another query (by setting some dropdown/checkbox etc. and then pressing a
button on the form, I do the following:

1. On the click event for the button I set EnableCaching for the grid
sqldatasource to false.
2. On the datasource Selecting event I reset the EnableCaching to true.

The correct data is retrieved and displayed in the page...but if the user
then goes and tries to re-sort the grid with the new data he will get the
older dataset.

What is the correct way to clear the sqldatasource cached info from the
cache when I process the button click?

thanks