Is there a way to be notified in .NET when data changes in the Sql Server? Like an Event?

Is there a way to bind an event to Sql Server (specially Azure) so that, when there's new data in a table, for instance, my .NET process will be notified?

Another option that I tought about would be a Sql Server long polling query. That is, I execute a query but it does not return anything until there's something to return or when a timeout is reached.

To be more clear about my problem, I have a different threads in different instances of Windows Azure waiting for notifications. They must take action as soon as there is a new notification. I'd like not to keep them querying the database or the storage every 2 seconds.

Answers


Not in Azure. In box product you have Query Notifications and its derivatives (SqlNotificationRequest, SqlDependency and SqlCacheDependency), see The Mysterious Notification for details. You can use it as a LINQ wrapper with LinqToCache.

But Query Notifications are not supported on Azure. On Azure your application should notify whenever it updates the database, using Azure Queues.


Need Your Help

Eclipse: folder with jars in project

eclipse configuration classpath buildpath

When I work on small desktop projects I used to create lib folder in my project's root where I keep all project's jar dependencies. Then I use Configure Build Path -> Libraries -> Add JARs... to ma...

How to delete a chart (canvas) out of its scope?

javascript jquery html canvas chart.js

I need to figure out how to delete this chart because when I create a new one in the same spot, the previous one still shows through. The user originally selects something from a dropdown. Based on...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.