更新时间:2023-02-13 18:18:46
MySql中没有等效的服务。
为了做这样的工作,你必须编写一个处理客户端连接的服务器端应用程序跟踪它们,并处理客户端应用程序的所有SQL操作,通知连接的客户端任何成功的插入/删除/更新操作。
客户端应用程序必须接收来自服务器的通知并相应地更新自己。
保持最小值d,这是代码,维护和支持的痛苦。有一个原因,你不会在主流应用程序中经常看到这一点。
有一个 MySqlDependency [ ^ ]类,但需要安装用于MySQL的dbExpress驱动程序 [ ^ ](应付)。
我在 Devart论坛:数据库监控 [ ^ ]
C\Hello< i'm working on C# and Mysql.
I want to sync DataGridView in my application with specific table in Mysql Database
in Microsoft SQLServer there was 'Sqldependency' is there something like that in my sql?
i want to monitor changes in my sql
What I have tried:
is the only to do that is creating a timer and execute the query repeatly?
There is no equivalent service in MySql.
In order to make something like this work, you would have to write a server-side application that handles client connections and tracks them, and handles all SQL operations for your client applications, notifying the connected clients of any successful insert/delete/update operations.
The client applications would have to receive the notification from the server and update themselves accordingly.
Keep in mind, this is a pain in the ass to code, maintain, and support. There's a reason why you don't see this very often in mainstream applications.
There's a MySqlDependency[^] class, but it needs to install dbExpress driver for MySQL[^] (payable).
I've found it on Devart forum: Database Monitoring[^]