• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 777
  • Last Modified:

SQLDataSource SQLCacheDependency with MSSQL 2008 R2

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">

Open in new window

      <sqlCacheDependency enabled="true">
          <add connectionStringName="IMConnectionString" name="IM" pollTime="1000"/>

Open in new window

Thank you in advance for your help!
  • 2
1 Solution
echobridgeSenior Software EngineerAuthor Commented:
That is a forum post from 2006, does that still apply in SQL Server 2008 R2?
echobridgeSenior Software EngineerAuthor Commented:
No resolution found.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now