Link to home
Start Free TrialLog in
Avatar of echobridge
echobridgeFlag for United States of America

asked on

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">
                ...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!
Avatar of eli411
eli411

ASKER CERTIFIED SOLUTION
Avatar of echobridge
echobridge
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of echobridge

ASKER

No resolution found.