ASP.NET Notifications for changes in database
We have a window application and a web application, and both connect to a same database to handle data. User on web application will do some changes and wait for the approve from users on window application. Is there any way to show a live update or notification on web application whenever an approve is made at window application which is lead to change in database? Note: we use ASP.NET for web application and .NET for开发者_StackOverflow中文版 windows application
This link which talks about SQLDependency and Query Notification seems to be what you are looking for.
You could setup a "notification" area within an updatepanel, or just use straight up ajax to make queries to the database on a specified interval as well.
There are several options.
you can refresh your ASP.NET page by regular interval. http://www.devcurry.com/2009/03/how-to-refresh-aspnet-gridview.html
Refresh a portion of the page periodically using AJAX. I would use jquery for the ajax stuff: jquery.com
Not sure how long the approval process is expected to take, but you could set the page to poll the server every 5 seconds, 15 seconds, whatever makes sense. If it's just refreshing a small portion of the page, it shouldn't be too much of a burden on the server relative to reloading the entire page at every interval.
精彩评论