如何创建“事件"?在MySQL中 [英] How To create an "event" in MySQL

查看:79
本文介绍了如何创建“事件"?在MySQL中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我是C#开发人员/MySQL管理员的新手,我想弄清楚每当更新表或插入新记录时,如何让MySQL表将表更新或插入表发送到C#客户端应用程序. />
到目前为止,我一直在使用一种非常粗糙的方式来完成此任务;我一直在做的事情是使用C#客户端应用程序中的计时器每秒查询MySQL表并检查是否有更新,如果发生了更新,则将数据从表中拉入C#客户端以进行可视显示. br/>
有人能正确地指出正确的做法吗?

谢谢,

-Donald

Hi,

I''m a novice C# developer/MySQL admin and I''m trying to figure out how do I have a MySQL table send table updates or inserts to a C# client app whenever the table is updated or a new record is inserted.

As of now I''ve been using a really crude way of accomplishing this; what I''ve been doing is using a timer in the C# client app to query the MySQL table every second and check for an update and if an update occurred then I pull this data from the table into the C# client for visual display.

Can someone please point me in the right direct as to the correct way of doing this.

Thanks,

-Donald

推荐答案

看看^ ]组件.特别是备注"部分.

听起来像您想要的吗?

如果是这样,那么(理论上,至少从理论上讲,我从未使用过.)您要做的就是将BindingSource的DataSource属性设置为当前数据源,然后将控件的DataSource设置为
Take a look at the MSDN Docs for the BindingSource[^] Component. Particularly the Remarks section.

Does this sound like what you want?

If so, then (theoretically, at least. I''ve never used it with MySql.) all you have to do is set the DataSource property of the BindingSource to whatever is your current data source, then set the DataSource for your controls to the BindingSource.


感谢亨利·分钟(Henry Minute)的回答,但这不是我想要的.我不想将控件绑定到表.每次更新表时我都需要分析数据库表数据,如果它满足特定条件,那么我将通过控件将其显示出来.

我希望数据库表将更新的记录发送到一个对象,该对象分析该记录并确定是否应显示该记录.
Thanks for the response Henry Minute but that''s not what I''m looking for. I don''t want to bind the control to the table. I need to analyze the database table data each time the table is updated and if it meets a certain criteria then I''ll display it in via the control.

I want the database table to send the updated record(s) to an object that analyzes the record(s) and determines if it should displayed.


这篇关于如何创建“事件"?在MySQL中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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