HighTechTalks DotNet Forums  

SQL Server Cache dependency not working

Visual Studio.net (General) microsoft.public.vsnet.general


Discuss SQL Server Cache dependency not working in the Visual Studio.net (General) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
RuthG
 
Posts: n/a

Default SQL Server Cache dependency not working - 06-14-2009 , 10:11 PM






I am using Visual Studio and asp.net. My main page shows a summary list of
all accounts. The data source for the select is a SQL Server stored procedure
that accesses 3 tables. A button on the page can redirect the user to a page
for entering a new account. That page can insert data into all 3 tables.
After the insert stored procedure runs, I redirect the user back to the first
page but the new data does not show up there. Here is how I set up the cache
dependency:

1. From Visual Studio, command line, aspnet_regsql, I enabled database cache
dependency and also ran it for 4 table ( the 3 referenced above and one more
that I want to reflect updates.) Note my -S had to refer to a named instance
(localhost didn't work) because I can be running different instances on my
computer for different projects. This seemed to work fine and generate the
proper tables.
2. I added a <caching> element to <system.web> in web.config:
<caching>
<sqlCacheDependency enabled="true">
<databases>
<add name="AdminiSafe"
connectionStringName="AdminiSafeConnectionString2" />
</databases>
</sqlCacheDependency>

</caching>
3. To my SQLDataSource on my main master page (the datasource and master are
used on multiple pages - so they are defined in a master), I added to Enable
Caching =" true":
CacheDuration="3600"

SqlCacheDependency="AdminiSafe:Table1;AdminiSafe:T able2;AdminiSafe:Table3"

This all had no effect. The new data I inserted into the tables did not show
up on the main page until the CacheDuration passed. Did I miss something? Is
there a problem because I am using a master page?

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.