Is There A Way To Be Notified In .net When Data Changes In The Sql Server? Like An Event?
Solution 1:
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.
Solution 2:
You can use SqlTableDependency
SqlTableDependency is a generic C# component used to receive notifications when the content of a specified database table change.
What is the difference with .NET SqlDepenency ?
Basically, the main difference is that SqlTableDependency send events containing values for the record inserted, changed or deleted, as well as the DML operation (insert/delete/update) executed on the table: SqlDepenency doesn't tell what data was changed on the database table, they only say that something has changed.
Post a Comment for "Is There A Way To Be Notified In .net When Data Changes In The Sql Server? Like An Event?"