echobridge
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:
Code for the SQLDataSource:
Web.config
Thank you in advance for your help!
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.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?
To enable a database for SQL cache notification, please use the System.Web.Caching.SqlCacheDependenc yAdmin.Ena bleNotific ations method, or the command line tool aspnet_regsql. To use the tool, please run 'aspnet_regsql.exe -?' for more information.
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>
Web.config
<system.web>
<caching>
<sqlCacheDependency enabled="true">
<databases>
<add connectionStringName="IMConnectionString" name="IM" pollTime="1000"/>
</databases>
</sqlCacheDependency>
</caching>
Thank you in advance for your help!
http://forums.asp.net/t/1006958.aspx/1
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
No resolution found.