SqlDependency.Start - Exception 'Invalid object name…"

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



SqlDependency.Start - Exception 'Invalid object name…"



I am attempting to use the SqlDependency Object to monitor changes in SQL server but I am having an issue with the SqlDependency.Start command.



In SQL server I issue these commands


CREATE QUEUE PJLTestQueue2;
CREATE SERVICE PJLTestService2 ON QUEUE PJLTestQueue2 ([http://schemas.microsoft.com/SQL/Notifications/PostQueryNotification]);



In my code I have


readonly string ConnectionString = "Data Source=***"
readonly string queueName = "PJLTestQueue2";
SqlDependency.Start(ConnectionString, queueName);



It throws and the exception message is: "Invalid object name 'PJLTestQueue2'."



I can issue the command select *from sys.service_queues and I see the PJLTestQueue2 in the output.



Do I need to configure the queue differently?



Is there some permission that I am missing?





Have you checked that the user does have all permissions for service broker? whichever account your app is using would need RECIEVE permissions on the queues, SEND on FROM service and REFERENCES on contract
– Gibbon
Aug 8 at 20:01









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard