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!
About Scott
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.
About Newsletter
Comments are closed.
interesting. btw, any info on how to use the dependecies with the sqldatasource control?