Solved

SQLDataSource SQLCacheDependency with MSSQL 2008 R2

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
TSQL Challenge... 7 37
Designing forms 3 18
Google Maps with Webforms 1 14
I need help changing the default value for an @HTML.LabelFor control 4 21
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

831 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