Solved

SQLDataSource SQLCacheDependency with MSSQL 2008 R2

Posted on 2013-06-27
3
731 Views
Last Modified: 2013-09-14
Running: ASP.NET ver. 4.5. MSSQL 2008 R2

I'm trying to get caching with SQL dependency working on a SQLDataSource control. However, I get the following error in runtime:

The database 'IM' is not enabled for SQL cache notification.

To enable a database for SQL cache notification, please use the System.Web.Caching.SqlCacheDependencyAdmin.EnableNotifications method, or the command line tool aspnet_regsql. To use the tool, please run 'aspnet_regsql.exe -?' for more information.
My confusion is that I believe cache notifications were discontinued after 2005 and replaced with a new service in 2008 R2. Is this correct? If so, what do I need to do to allow for caching with dependency out of the SQLDataSource?

Code for the SQLDataSource:
<asp:SqlDataSource ID="custItemsDS" runat="server" ConnectionString="<%$ ConnectionStrings:IMConnectionString %>" SelectCommand="...select command..." UpdateCommand="...update command..." EnableCaching="True" SqlCacheDependency="IM:ct_CustItem">
                ...parameters...
</asp:SqlDataSource>

Open in new window


Web.config
  <system.web>
    <caching>
      <sqlCacheDependency enabled="true">
        <databases>
          <add connectionStringName="IMConnectionString" name="IM" pollTime="1000"/>
        </databases>
      </sqlCacheDependency>
    </caching>

Open in new window


Thank you in advance for your help!
0
Comment
Question by:echobridge
  • 2
3 Comments
 
LVL 2

Expert Comment

by:eli411
ID: 39282448
0
 
LVL 1

Accepted Solution

by:
echobridge earned 0 total points
ID: 39282470
That is a forum post from 2006, does that still apply in SQL Server 2008 R2?
0
 
LVL 1

Author Closing Comment

by:echobridge
ID: 39492411
No resolution found.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question