From what I understand (I haven't tried it and would double check with the experts in the mentioned forum), but SqlDependency inherently needs the state of the result set to be maintained. This allows the application to be notified that the data has changed and that it needs to update it's cache.
When a call to a stateless web service is made the objects created during the call are marked for garbage collection at the end. The lifetime of the object is limited to the scope of the method call. You could extend the lifetime by adding the object to the cache. However, that implies enabling state/caching. If you did so, you'll need to evaluate the scope of the cache if you have a Web farm scenario.
Hope that helps, Anand
PS: If you find a solution please post an update, I'd be interested too.
"You can write a query notification client in ADO.NET as we'll be doing, using OLE DB, or even using the new HTTP Web service client, but a point to remember is that query notifications are only available through client-side code."
Does the 'new' refer to the new Indigo web service
Your question is related to ASP.NET Web services and SQL Server Query Notifications. I would recommend posting your question on ASP.NET Web services forum and/or the SQL Server Data Access forum.
This forum is focused on SQL Server Notification Services (SQL-NS). I agree the names can be confusing. SQL-NS (in a nutshell) is a platform based on the pub-sub model of gathering "external" events and deliver customized notifications through various different delivery channels like email, SMS, etc. This is probably not what you're looking for.
Hope you find the right people to answer your question.
Using SqlDependency in Web Servive Context
Scott Vande Krol
From what I understand (I haven't tried it and would double check with the experts in the mentioned forum), but SqlDependency inherently needs the state of the result set to be maintained. This allows the application to be notified that the data has changed and that it needs to update it's cache.
When a call to a stateless web service is made the objects created during the call are marked for garbage collection at the end. The lifetime of the object is limited to the scope of the method call. You could extend the lifetime by adding the object to the cache. However, that implies enabling state/caching. If you did so, you'll need to evaluate the scope of the cache if you have a Web farm scenario.
Hope that helps,
Anand
PS: If you find a solution please post an update, I'd be interested too.
anil_m_s
After reading this article (http://msdn.microsoft.com/library/default.asp url=/library/en-us/dnvs05/html/querynotification.asp) - I would like you to clarify something for me:
"You can write a query notification client in ADO.NET as we'll be doing, using OLE DB, or even using the new HTTP Web service client, but a point to remember is that query notifications are only available through client-side code."
Does the 'new' refer to the new Indigo web service
Thanks.
Badekapp
This forum is focused on SQL Server Notification Services (SQL-NS). I agree the names can be confusing. SQL-NS (in a nutshell) is a platform based on the pub-sub model of gathering "external" events and deliver customized notifications through various different delivery channels like email, SMS, etc. This is probably not what you're looking for.
Hope you find the right people to answer your question.
Regards,
Anand