SqlDependancy.Start and Conversation Handle Not Found

When doing this with the Aug CTP:

Response.Write("Page created: " + DateTime.Now.ToLongTimeString())
Dim connStr As String = ConfigurationManager.ConnectionStrings("AppConnectionString1").ConnectionString
System.Data.SqlClient.SqlDependency.Start(connStr) ‘BOOM
Dim connection As New SqlConnection(connStr)
Dim command As New SqlCommand("Select * FROM Customers", connection)
Dim sqlDependency As New SqlCacheDependency(command)
connection.Open()
GridView1.DataSource = command.ExecuteReader()
GridView1.DataBind()
Connection.Close()
Response.AddCacheDependency(sqlDependency)

I got this:

Message="The conversation handle "206A971D-6F25-DA11-B22F-0003FF6FCCCA" is not found.
Invalid object name 'SqlQueryNotificationService - 41136655-4314-4536-a477-37156eb628db'."

And fixed it with this "alter database Northwind set trustworthy on". Thanks Steve Smith!

Tracked by:
"More SqlDependency Gotchas" (Steven Smith) [Trackback]
Thursday, September 15, 2005 10:31:27 PM UTC
Hello Scott.
interesting. btw, any info on how to use the dependecies with the sqldatasource control?
Comments are closed.
Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer’s view in any way.