sqldependency vs sqlnotificationrequest。哪个更好用? [英] sqldependency vs sqlnotificationrequest. which is better to use ?

查看:411
本文介绍了sqldependency vs sqlnotificationrequest。哪个更好用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Sqldependency和SqlNotificationrequest之间的主要区别是什么?哪个更好用?

What are the key differences between Sqldependency and SqlNotificationrequest and which is better to use ?

推荐答案

SqlNotificationRequest 在内部使用 SqlDependency 订阅查询事件。我会在 SqlDependency 上使用 SqlNotificationRequest ,因为大部分布线已经完成,这意味着可以更轻松地使用通知。从技术上讲,因为一个在内部使用另一个,两者没有区别,只有一个有很多设置工作。
SqlNotificationRequest uses SqlDependency internally to subscribe to query events. I would use SqlNotificationRequest over SqlDependency because most of the wiring is already done and it is meant to make using notifications easier. Technically because one uses the other internally, there is no difference in the two, just one has a lot of the setup work done.


In case of SQLDependency/SQLNotificationRequest you require separate queue per process. If your different processes listen on the same queue then event notification is not guaranteed. But this is how it is right now.


这篇关于sqldependency vs sqlnotificationrequest。哪个更好用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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