Hi:
We are using Vista Home (32 bit PC)
Visual Studio 2008 and SQL SERVER 2008
The original example for
Using SqlDependency in a Windows Application as written above did not work for me.
I can update the database and display the grid results fine.
But there was no notification.
However playing with
the following lines:
' Remove any existing dependency connection, then create a new one.
SqlDependency.Stop(GetConnectionString(), My.Settings.queue)
SqlDependency.Start(GetConnectionString(), My.Settings.queue)
Dim dependency As New SqlDependency(command, "service=ContactChangeNotifications;Local database=AdventureWorks", 432000)
where My.Settings.queue = ContactChangeMessages
And trying the steps below I finally got it to work.
references:
http://msdn.microsoft.com/en-us/library/a52dhwx7%28VS.80%29.aspx
http://msdn.microsoft.com/en-us/library/ms172133(VS.80).aspx
ALTER DATABASE AdventureWorks SET ENABLE_BROKER;
CREATE QUEUE ContactChangeMessages;
CREATE SERVICE ContactChangeNotifications
ON QUEUE ContactChangeMessages
([http://schemas.microsoft.com/SQL/Notifications/PostQueryNotification]);