title: Enabling Service Broker in SQL Server 2008
body: <p>I am integrating SqlCacheDependency to use in my LinqToSQL datacontext.</p>
  
  <p>I am using an extension class for Linq querys found here - <a href="http://code.msdn.microsoft.com/linqtosqlcache" rel="noreferrer">http://code.msdn.microsoft.com/linqtosqlcache</a></p>
  
  <p>I have wired up the code and when I open the page I get this exception - </p>
  
  <p>"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."</p>
  
  <p>its coming from this event in the global.asax</p>
  
  <pre><code>        protected void Application_Start()
      {
          RegisterRoutes(RouteTable.Routes);
          //In Application Start Event
          System.Data.SqlClient.SqlDependency.Start(new dataContextDataContext().Connection.ConnectionString);
  
      }
  </code></pre>
  
  <p>my question is...</p>
  
  <ol>
  <li><p>how do i enable Service Broker in my SQL server 2008 database? I have tried to run this query.. ALTER DATABASE tablename SET ENABLE_BROKER but it never ends and runs for ever, I have to manually stop it.</p></li>
  <li><p>once I have this set in SQL server 2008, will it filter down to my DataContext, or do I need to configure something there too ?</p></li>
  </ol>
  
  <p>thanks for any help</p>
  
  <p>Truegilly</p>