如何设置的SqlDependency监视多个表 [英] How to setup SqlDependency to monitor multiple tables

查看:1593
本文介绍了如何设置的SqlDependency监视多个表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找出如何监视多个表用的SqlDependency。所有我发现的例子是一张表。

I am trying to figure out how to monitor more than one table with a SqlDependency. All the examples I have found are for one table.

我有多个类,再present显示器特定表。每一次改变事件引发我停止依赖,并开始一个新的但unhooks的其他显示器。我如何得到它随时监控多个表?我需要一个事件被抓住了每次重新转播所有的显示器?

I have multiple classes that represent a monitor for a specific table. Each time a change event is raised I stop the dependency and start a new one but that unhooks the other monitors. How do I get it to keep monitoring for multiple tables? Do I need to re-hookup all the monitors each time an event is caught?

推荐答案

使用<一个href="http://msdn.microsoft.com/en-us/library/system.web.caching.aggregatecachedependency%28v=VS.90%29.aspx"相对=nofollow> AggregateCacheDependency 类在多个表设置的依赖。

Use AggregateCacheDependency class to setup dependency on multiple tables.

这篇关于如何设置的SqlDependency监视多个表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆