在Windows窗体C#应用程序的不同实例中自动刷新数据源

发布于 2024-09-01 17:57:48 字数 170 浏览 10 评论 0原文

我有 [.NET 3.5] C# win 表单应用程序的不同实例,它们在不同的计算机上运行。

所有实例都使用相同的 SQL 2005 数据库。

当应用程序的另一个实例在数据库中更改时,我需要发送警报并刷新网格[包含在用户控件中]。

哪个是最好的方法?

非常感谢。

I have different instances of an [.NET 3.5] C# win forms application that run on different machines.

All instances use the same SQL 2005 db.

I need to send an alert and to refresh grids [contained in user controls] when another instance of the application changes smth in db.

Which is the best way ?

Thank you very much.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

暮色兮凉城 2024-09-08 17:57:48

AS David 表示,当 SQL Server 本身在数据更改时发送通知时,选项之一是 SqlDependency。但是您也可以使用 WCF(或任何其他分布式解决方案)来保持 2 个实例之间的通信并相互通知...

AS David said one of the options is SqlDependency when SQL server itself sends notifications when data is changed. But you can also use WCF(or any other distributed solution) to keep communication between 2 instances and notify each other...

风柔一江水 2024-09-08 17:57:48

使用 SqlDepedency。这可以在 WinForms 和 Asp.NET 中完成。

请观看此视频:http://windowsclient.net/learn/video.aspx?v= 27881

(注意先决条件的技术说明)

Use an SqlDepedency. This can be done in WinForms as well as Asp.NET.

See this video: http://windowsclient.net/learn/video.aspx?v=27881

(pay attention to the technical note for prerequisites)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文