DataGridView在表更改时更新 [英] DataGridView updating on table change

查看:112
本文介绍了DataGridView在表更改时更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个表(在sql中)每天都会发生很大变化(例如,证券交易所!),

我在datagridview(以Windows窗体)中显示此表,更改后如何刷新数据?
我不希望通过线程(用于签入时间段),我希望它在表更新时刷新(例如事件或触发器).

请帮帮我.

在此先感谢.

Hi All,

I have a table (in sql) that changes a lot in day(like Stock Exchange! ),

I show this table in a datagridview (in Windows forms),how can I refresh the data when it changed?
I don''t want it by thread (to check in period),I want it to refresh when the table''s updated(like an event or trigger) .

Please Help me.

Thanks in Advance.

推荐答案

您可以在SQL Server的较新版本中运行.NET代码.如果可以这样做,则可以编写一个运行.NET代码的触发器.如果不能,则数据库无法告诉您数据已更改.相反,您需要查看执行插入和更新的代码,并使它们也触发一些向应用程序发送消息.该应用程序仅在您的网络中使用吗?如果不是,那么我认为您需要通过Internet发送消息?
You can run .NET code inside newer versions of SQL Server. If you can do that, you can write a trigger that runs .NET code. If you can''t, then there''s no way for the DB to tell you that data has changed. You need instead to look at the code that does the inserting and updating, and have that also trigger some message to the application. Is this app used only in your network ? If not, then you need to send messages over the internet, I assume ?


这篇关于DataGridView在表更改时更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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