SQL Server service broker reporting as off when I have written a query to turn it on

Posted by dotnetdev on Stack Overflow See other posts from Stack Overflow or by dotnetdev
Published on 2009-08-21T23:37:46Z Indexed on 2010/06/02 23:04 UTC
Read the original article Hit count: 246

I have made a small ASP.NET website. It uses sqlcachedependency

The SQL Server Service Broker for the current database is not enabled, and as a result query notifications are not supported. Please enable the Service Broker for this database if you wish to use notifications.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: The SQL Server Service Broker for the current database is not enabled, and as a result query notifications are not supported. Please enable the Service Broker for this database if you wish to use notifications.

Source Error:

Line 12: System.Data.SqlClient.SqlDependency.Start(connString);

This is the erroneous line in my global.asax.

However, in sql server (2005), I enabled service broker like so (I connect and run the SQL Server service when I debug my site):

ALTER DATABASE mynewdatabase SET ENABLE_BROKER with rollback immediate

And this was successful.

What am I missing? I am trying to use sql caching dependency and have followed all procedures.

Thanks

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about sql-server