Help needed, ASP.NET caching with SQL Server doesn't work



Hello! I'm trying to use ASP.NET caching with my web site and SQL Server,
but I have a problem.

I try to do everything according to the instructions like this page here:
http://www.eggheadcafe.com/articles/20060407.asp

First I run the aspnet_regsql tool on the command line succesfully to enable
the database for cache notification:
aspnet_regsql -S [SERVER] -E -d [database] -ed

Then I run the following command on the command line succesfully for each
table in the database:
aspnet_regsql -S [SERVER] -E -d [database] -et -t [table]

I added the necessary parts into the web.config file, so that it is like
this:

<connectionStrings>
<add name="ConnectionString1"
connectionString="Server=servername;Database=databasename;Trusted_Connection=yes"
/>
</connectionStrings>

<caching>
<sqlCacheDependency enabled="true" pollTime="2000">
<databases>
<add connectionStringName="ConnectionString1"
name="KJ"/>

</databases>
</sqlCacheDependency>
</caching>

Then I added the following line into the beginning of the page default.aspx
<%@ OutputCache Duration="86400" VaryByParam="*"
SqlDependency="KJ:ILMOITUKSET" %>

But when I run the page default.aspx it gives the following error:
-----------------------------
The 'ILMOITUKSET' table in the database 'KJ' is not enabled for SQL cache
notification.

Please make sure the table exists, and the table name used for cache
dependency matches exactly the table name used in cache notification
registration.

To enable a table for SQL cache notification, please use
SqlCacheDependencyAdmin.EnableTableForNotifications method, or the command
line tool aspnet_regsql. To use the tool, please run 'aspnet_regsql.exe -?'
for more information.

To get a list of enabled tables in the database, please use
SqlCacheDependencyManager.GetTablesEnabledForNotifications method, or the
command line tool aspnet_regsql.exe.
-----------------------------------
When I run aspnet_regsql.exe with the -lt parameter to see the list of
tables that are enabled for cache notification they are all enabled. Could
someone help me with this problem and tell me what I'm doing wrong? Thank
you so much in advance.

Toni



.



Relevant Pages

  • Re: Cannot use a CONTAINS or FREETEXT predicate on table...
    ... command from the context of the database I wish to publish. ... This database is not enabled for publication. ... The replication agent has been successfully started. ... Source: Microsoft SQL Native Client ...
    (microsoft.public.sqlserver.replication)
  • Re: SQL update in SQL database issue
    ... I am thinking if i change the database from Foxpro to SQL or MS Access, ... program installation require, if a table corrupted, user can just attach ... should I use SQL pass through command to update the Foxpro Database or ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Help needed, ASP.NET caching with SQL Server doesnt work
    ... are you using SQL Server 7 or 2000? ... enable the database for cache notification: ... Then I run the following command on the command line succesfully for each ... dependency matches exactly the table name used in cache notification ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Backup SQLExpress 2005 in code
    ... The backup statements can be done as DDL (Data Definition Language, a form of SQL Script), so you can send the commands to the database via that method. ... One option is to send as a SQL command, but that is not the best option, as you lock up a thread while the command is running. ...
    (microsoft.public.dotnet.framework)
  • Re: dataset saving to sql ce
    ... > I am attempting to save a dynamic dataset to sql ce, ... > create table command is as follows: ... > exception with the message "Update". ... > if ) // Get rid of existing database file ...
    (microsoft.public.dotnet.framework.compactframework)