Iframe旁边的SQL依赖? [英] SQLdependency beside Iframe?

查看:87
本文介绍了Iframe旁边的SQL依赖?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

https://docs.google.com/document/d/13bI5-pIekw17DFhA7-w7hdCA4WfbKkchMnP4kXb2e2I/edit?usp=sharing

https://docs.google.com/document/d/13bI5-pIekw17DFhA7-w7hdCA4WfbKkchMnP4kXb2e2I/edit?usp=sharing

我的SQL中有上表数据库。我想编写一个ASP.NET应用程序,以便在分离的AgentID中显示这些信息。我创建了一个AgentID
链接列表(< a />)和一个Iframe,这样当我点击AgentID链接时,Iframe将重定向到特定网站以显示自己的记录(我添加了AgentID)在iframe"src"属性中。

<跨度>&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;
我想在数据库发生变化时发出通知,我发现SQLdependency是最好的解决方案。对于每个AgentID请求,我添加带有"WHERE"语句的Sql查询命令以匹配指示的AgentID。当我尝试将选定的AgentID更改为其他时,我也已经使它工作但是
,SQLdependency的通知出错了。如果我尝试更改所选代理的记录,则SQLdependency会触发正确的通知,但是当我更改之前选择了
的记录时,它仍会触发通知并使某些东西变得奇怪。

            I want to make notification when the database has changed, and i found that SQLdependency is the best solution. For each AgentID request I add a Sql query command with "WHERE" statement to match the indicated AgentID. I also made it work already but when i try to change the selected AgentID to others, the SQLdependency’s notification went wrong. If i try to change the record of the selected Agent, the SQLdependency fired the properly notification, but when i change the record of the one i had selected before, it still fired the notification and make something weird.

   ;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;
任何人都可以帮我解决这个问题吗?

            Can anyone help me with this prolem?

   ;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;如果我的英语不太好,请告诉我。

推荐答案

在切换到另一个活动代理之前,您可能应该使用
SqlDependency.Stop()取消之前的侦听器。然后执行 SqlDependency.Start()并创建新的
SqlDependency

Before switching to another active agent, maybe you should cancel the previous listener using SqlDependency.Stop(). Then execute SqlDependency.Start() and create the new SqlDependency.


这篇关于Iframe旁边的SQL依赖?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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