Solved

SQLDataSource SQLCacheDependency with MSSQL 2008 R2

Posted on 2013-06-27
3
725 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
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…
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

747 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now