Last post Aug 30, 2011 02:30 AM by sandipraj21
Jul 10, 2006 05:47 PM|BoulderBum|LINK
I have a sqlCacheDependency element registered in web.config that I figured would set the database up to deliver all notifications for all its tables:
I've seen docs saying that's all I need to do with SQL Server 2005, but that doesn't appear to be the case. I get the error:
The database 'MyDB' 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.
Are the docs I read wrong or am I missing something?
Jul 10, 2006 06:54 PM|Soteriologist|LINK
I beleive the sytax would be:
And then on your aspx page:
Jul 11, 2006 12:08 PM|BoulderBum|LINK
The web.config file is set up correctly, my problem is that I can't get notification services working. I have to resort to polling although I have SQL Server 2005.
To add more detail, I'm using Windows XP Pro and I programatically add the SqlCacheDependency:
SqlCacheDependency myDependency = new SqlCacheDependency( "MyDb", "MyTable" );
Everything executes correctly, but unless I use the SqlCacheDependencyAdmin or aspnet_regsql to set up polling, it throws the error displayed in my first post. If I have polling set up, the error goes away, but I'm not taking full advantage of the performance
benefits of SQL Server 2005 notification services.
Jul 12, 2006 03:36 PM|BoulderBum|LINK
Jul 12, 2006 04:12 PM|Caddre|LINK
I think most of what you need is covered in the links below because it maybe permissions related. Hope this helps.
Jul 13, 2006 03:11 PM|BoulderBum|LINK
I wondered if there might be some permission issues, though I haven't discovered what permissions may be required.
What's curious is that I'd expect the SqlCacheDependency to throw some permissions exception in such a case, however, and I wasn't seeing that.
I'll have to keep digging...
Jul 18, 2006 10:01 PM|BoulderBum|LINK
Bump! I was hoping the issue would go away when I moved our SQL Server to a development server, but the problem persists.
1. I discovered SQL Server can't run under the local machine account for Notification Services to work properly so I switched to Network Service... didn't help.
2. Apparently you need to manually create a Service Broker endpoint and enable the database to use it. Also didn't help...
3. I read a lot of people said they have to call SqlDependency.Start() to get it working... didn't help.
Jul 19, 2006 12:46 PM|Caddre|LINK
Jul 20, 2006 12:27 PM|BoulderBum|LINK
Jul 27, 2006 03:05 PM|BoulderBum|LINK
1. You can't use the constructor I was using to set up notification-based dependencies (you need to pass in the SqlCommand).
2. You need to exclude the command SET NOCOUNT ON from your stored procedure.
http://forums.asp.net/1353521/ShowThread.aspx#1353521 for more.
Feb 22, 2008 06:08 AM|ptyagi|LINK
Regarding "Notification Services" of Sql server 2005,
1. Is "Notification Services" is not avaialable with 'Developer edition' of Sql Server 2005?
2. Did U give any SUBSCRIBR or SEND Rights to users?
GRANT SUBSCRIBE QUERY NOTIFICATIONS TO
GRANT SEND ON SERVICE::SqlQueryNotificationService TO
Aug 30, 2011 02:28 AM|sandipraj21|LINK
u can refer this url
Aug 30, 2011 02:30 AM|sandipraj21|LINK