关于表数据更新C#的Catch / Raise事件(Catch/Raise event on table data update C#)

编程入门 行业动态 更新时间:2024-10-27 18:23:37
关于表数据更新C#的Catch / Raise事件(Catch/Raise event on table data update C#)

我有24/7服务,它保持Sql Server中的充电,路由等设置(配置数据)。 启动后,它使用Linq2SQL从表中加载数据,并通过所有应用程序使用数据。 我们需要一种解决方案来更新表中的设置数据,而无需重新启动应用程序。 所以我感兴趣的是可以捕获/确定表已更新,因此我可以刷新应用程序中的设置数据。 我的意思是,当表上有任何删除,更新或插入时,可能会有事件发生。

谢谢。

I have 24/7 service which keeps setup (configuration data) for charging, routing and etc in the Sql Server. Once it is started it loads the data from table using Linq2SQL and use the data through all the application. And we need a solution to update the setup data in the table without restarting the application. So I am interested is it possible to catch/determine that the table was updated so I can refresh the setup data in the application. I mean is it possible to have events which will raise when there is any delete, update or insert on the table.

Thank you.

最满意答案

您正在寻找SqlDependency类 。

You're looking for the SqlDependency class.

更多推荐

本文发布于:2023-08-04 02:11:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1408842.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:事件   数据   Raise   Catch   update

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!