S
scotty
In testing Notifications, adding the following lines to an Asp.Net
page make the notification process almost fully automatic:
SqlCacheDependencyAdmin.EnableNotifications(WebConfigurationManager.ConnectionStrings["Northwind"].ConnectionString);
SqlCacheDependencyAdmin.EnableTableForNotifications(ConfigurationManager.ConnectionStrings["Northwind"].ConnectionString,new
string[] { "Employees", "Categories", "Products"});
The two lines properly prepare the notifications table
( AspNet_SqlCacheTablesForChangeNotification ) in the database to be
accessed. If you delete the table
AspNet_SqlCacheTablesForChangeNotification, the lines restore it
properly as well.
But can you automate the processes required to make sure the AspNet
database exists with its proper table? The table that is created when
you run the command > aspnet_regsql -ed -E -d AspNet from the
command prompt? I thought I could trigger a batch file but you can't
do this within Asp.Net. Are there lines similar to the two noted
above that creates and prepares the AspNet database and its
corresponding AspNet_SqlCacheTablesForChangeNotification table?
Or does this part of it have to be done manually? Create the AspNet
table then run the command line aspnet_regsql -ed -E -d AspNet.
SQLServer 2000. I guess the AspNet database could be created if it
doesn't exist and you could probably test for the existence of the
required table, but thought there might be lines that do this
automatically.
page make the notification process almost fully automatic:
SqlCacheDependencyAdmin.EnableNotifications(WebConfigurationManager.ConnectionStrings["Northwind"].ConnectionString);
SqlCacheDependencyAdmin.EnableTableForNotifications(ConfigurationManager.ConnectionStrings["Northwind"].ConnectionString,new
string[] { "Employees", "Categories", "Products"});
The two lines properly prepare the notifications table
( AspNet_SqlCacheTablesForChangeNotification ) in the database to be
accessed. If you delete the table
AspNet_SqlCacheTablesForChangeNotification, the lines restore it
properly as well.
But can you automate the processes required to make sure the AspNet
database exists with its proper table? The table that is created when
you run the command > aspnet_regsql -ed -E -d AspNet from the
command prompt? I thought I could trigger a batch file but you can't
do this within Asp.Net. Are there lines similar to the two noted
above that creates and prepares the AspNet database and its
corresponding AspNet_SqlCacheTablesForChangeNotification table?
Or does this part of it have to be done manually? Create the AspNet
table then run the command line aspnet_regsql -ed -E -d AspNet.
SQLServer 2000. I guess the AspNet database could be created if it
doesn't exist and you could probably test for the existence of the
required table, but thought there might be lines that do this
automatically.