我用:
创建一个SqlDependencySqlDependency dependency = new SqlDependency(command);
但是我找不到dependency.id(或任何其他属性):
SELECT * FROM sys.dm_qn_subscriptions
有没有办法匹配它们,所以我可以检查我创建的依赖项是否仍然存在。
答案 0 :(得分:0)
我发现了一篇可能对您有帮助的文章:Instant Database Changes Using SignalR
在执行AddSqlDependency方法后,必须执行sqlCommand.ExecuteReader()才能使其正常工作。
希望这对您有用。