A> Change the SQLDependency from your DB:table name to CommandNotification
B> And in the Global.asax file under Application_Start event start the SQL Dependancy. That's it!
System.Data.SQLClient.SQLDependancy.Start(ConnectionString)
1> NO POLLING FROM THE ASP.net runtime
2> AVOIDS DATABASE TRIPS UNNECESSARILY
3> SQL SERVER 2005 automatically sends notification whenever there is change in the data (at table level)
4> SILENT communication between SQL engine and .net runtime
5> Performance benefit compared to ASP.net polling
Note: You need to have SQLCacheDependancy enabled = True in web.config file
Cheers - DJ
No comments:
Post a Comment