SQL Server 2005 comes with a new concept which lets you to get automatic notifications to your client application whenever some data is changed in your database. The Query Notification and SQL Server Service Broker helps you in doing so. In this post I am going to show you how you could utilize this concept to build your own query notifiers for your own client application.
It is somewhat a common practice for an application working with real-time day is to poll the database server every now and then to get the updates. We generally poll the database using a background Timer and update the data whenever new data comes in. Hence we loosen up a lots of resources while calling the database so much and even ruin our application overall performance.
The idea of this post is to let you understand the basics of Query Notification and let you through by building an application that gets automatic notification from the SQL Server itself and update the UI. SQLDependency is a class provided with .NET Base class library which enables you to get notification when SQLCommand changes its output.
I have posted an article demonstrating the concept clearly using some sample application one with a WPF windows client that gets notification alerts instantly and another an ASP.NET application that invalidates cache based on the Dependency.
Read the Entire Article.
Read Disclaimer Notice
Author's new book
Abhishek authored one of the best selling book of .NET. It covers ASP.NET, WPF, Windows 8, Threading, Memory Management, Internals, Visual Studio, HTML5, JQuery and many more...
Grab it now !!!
Grab it now !!!