SQL Notification Services


Author
Message
Aaron Young
Aaron Young
Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)
Group: StrataFrame Users
Posts: 277, Visits: 1.1K
I haven't used SQL Notification Services before so this is all new to me.

I have notification services installed, the broker service is enabled on the database and I have set the BO ReceiveQueryNotifications to True. When I run a form containing the BO I get the error:-

"When using SqlDependency without providing an options value, SqlDependency.Start() must be called prior to execution of a command added to the SqlDependency instance"

I have done nothing in SQL Notification Services itself as I have assumed SF handles this for me. Are there any additional steps I have missed in Notification Services itself?

Thanks in advance,

Aaron

Replies
Aaron Young
Aaron Young
Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)
Group: StrataFrame Users
Posts: 277, Visits: 1.1K
Ah, I don't think I have the dbo in my query either. I am using

"SELECT " + AllFieldNames + " FROM " + TableName

and I think the latter doesn't have the dbo. I will change this and try again.

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Sounds good.
Aaron Young
Aaron Young
Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)
Group: StrataFrame Users
Posts: 277, Visits: 1.1K
I have tried "SELECT " + AllFieldNames + " FROM " + TableNameAndSchema and I get the same error. I have looked at your sample and I think I am doing the same.

Did you have to setup or initialise SQL Notification Services itself other than the ALTER DATABASE xxxxx SET ENABLE_BROKER? My SQL Notification Services was simply installed out of the box with no post configuration beyond the intial setup.

I will be away for a couple of days so thanks in advance.

Aaron

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
The user to which is trying to subscribe has to have those permissions as well.  StrataFrame does everything that has to be done on the .NET side in regards to setting up the SqlDependency and then notifying you of the changes.  However, the part that you are having the issue with is more than likely the SQL side...and getting it setup.  This is one reason that we elect not to use Query notifications in the field as you can fight this issue often...so we generally take another aproach. 

But back to the point of the matter, to grant a subscription permission to a user you would do this:

GRANT SUBSCRIBE QUERY NOTIFICATIONS TO [sqldependency_user]

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Aaron Young - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Aaron Young - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Aaron Young - 17 Years Ago
                         Sounds good.
Trent L. Taylor - 17 Years Ago
                             I have tried "SELECT " + AllFieldNames + " FROM " + TableNameAndSchema...
Aaron Young - 17 Years Ago
                                 The user to which is trying to subscribe has to have those permissions...
Trent L. Taylor - 17 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search