[英]sql notification error running on Microsoft Windows Server 2008 R2
I want to get notification for a new record inserted into the database with this code: 我想获得有关使用以下代码插入数据库的新记录的通知:
var perm = new SqlClientPermission(System.Security.Permissions.PermissionState.Unrestricted);
perm.Demand();
SqlDependency.Stop(connectionString);
SqlDependency.Start(connectionString);
// I got an exception here when running the application "Windows 2008 Ent R2 SP1 64Bit" //运行应用程序“ Windows 2008 Ent R2 SP1 64Bit”时出现异常
Error of starting database Watcher: Cannot find the user 'owner', because it does not exist or you do not have permission. 启动数据库监视程序的错误:找不到用户“所有者”,因为它不存在或您没有权限。
Cannot find the queue 'SqlQueryNotificationService-f41563c5-3c26-4469-8447-3ee41c801a55', because it does not exist or you do not have permission. 找不到队列'SqlQueryNotificationService-f41563c5-3c26-4469-8447-3ee41c801a55',因为该队列不存在或您没有权限。
Invalid object name 'SqlQueryNotificationService-f41563c5-3c26-4469-8447-3ee41c801a55'. 无效的对象名称'SqlQueryNotificationService-f41563c5-3c26-4469-8447-3ee41c801a55'。
I already have done this for the database and the user: 我已经为数据库和用户完成了此操作:
ALTER DATABASE [dbName] SET ENABLE_BROKER
use [dbName] GRANT SUBSCRIBE QUERY NOTIFICATIONS TO [dbUser]
So where could be the cause? 那么,原因可能在哪里呢?
Thanks in advance. 提前致谢。
看一下MSDN ,您使用的连接有一些限制
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.