Search code examples
asp.net-mvcsqldependency

How to apply Sql Dependency in ASP.NET MVC?


How can we apply Sql Dependency in Asp.Net MVC for cached objects?


Solution

  • MSDN says:

    To set up a dependency, you need to associate a SqlDependency object to one or more SqlCommand objects. To receive notifications, you need to subscribe to the OnChange event.

    If you are using an ORM for your data model, I'm not sure how this applies.

    More info here:

    http://msdn.microsoft.com/en-us/library/t9x04ed2.aspx