Reg:自动刷新,无任何事件 [英] Reg:Automaticacally Refresh without any Event

查看:108
本文介绍了Reg:自动刷新,无任何事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我希望这种帮助,例如,在sql one表中进行任何更新/插入时,当时该如何自动刷新datagridview而没有任何前端事件调用.我的应用程序托管在具有集中式一台服务器的多个客户端中.

重播Pl ...
Palani

Hi,
I hope this help,for example while any update/Insert is occur in sql one table, at that time how automatically refresh datagridview without any front end event call.My application is hosted in multiple client with centralized one server.

Replay Pls...
Palani

推荐答案

SQL Server的较新版本使您可以在其中运行.NET代码.您可以有一个触发器来在更新表时触发,我想让触发器在您的表示层触发一个事件是可行的,但是对于您的代码向所有客户端触发一个事件同样有意义,或让您的数据源仅定期刷新.如果没有在表示层中触发某种事件,并告诉它这样做,datagridview就无法刷新.
Newer versions of SQL Server let you run .NET code inside them. You can have a trigger that fires when a table is updated, I imagine it''s feasible to have that trigger fire an event in your presentation layer, but it makes just as much sense for your code to fire an event to all clients, or for your data source to just refresh periodically. There is no way your datagridview can refresh without some sort of event firing in the presentation layer, telling it to do so.


我认为如果某些数据需要立即刷新客户端浏览器,是通过其他用户插入的,则需要使用AJAX重复调用服务..

假设您使用setInterval调用服务器并ping到客户端中存在的GUID.现在,当数据更新时,只需替换服务器中的GUID,并且对服务执行ping操作的每个客户端都将知道数据已更新并且需要刷新.

您可能还会去
用于ASP.NET Web应用程序的基于COMET(或反向AJAX)的网格控制-可扩展,高性能和低延迟的网格控制 [ ^ ]

:cool:
I think if you need to refresh your client browser instantly when some data is inserted through other user, you need to use AJAX to repeatedly call to a service..

Say you call the server using setInterval and ping to a GUID which is there in the client. Now when the data is updated, just replace the GUID in the server, and every client which ping the service will know that the data is updated and need to refresh.

You might also go for
COMET (or Reverse AJAX) based Grid Control for ASP.NET Web Applications - Scalable, High Performance and Low Latency Grid Control[^]

which uses the similar technique as you require.:cool:


这篇关于Reg:自动刷新,无任何事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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