如何每秒从数据库更新一次? [英] How to update every second from db?

查看:101
本文介绍了如何每秒从数据库更新一次?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须建立一个像拍卖网站这样的网站:

I have to build a site like an auction-site:

我有一个详细页面,其中包含应该倒计时的项目.

I Have a detail page from items where a countdown should run down.

在此页面中,几乎每秒钟都必须进行更新,而无需用户回发:

In this page nearly every second a update must be possible without a postback for the user:

  • 降级必须重设
  • 奥克顿的钱必须更新
  • 最后竞标者的gridView必须更新

我应该使用哪种计时器进行倒计时?如何每秒从数据库更新一次?(阿贾克斯?)如何更新值/gridView?

What kind of timer should I use for the countdown? How can I update every second from DB? ( Ajax? ) How can I update the values / gridView?

推荐答案

您可以将UpdatePanel与Ajax一起使用.

You can use an UpdatePanel with Ajax.

但是,考虑到"Internet天气"的本质,每次更新一秒钟对于这种方法来说是非常激进的.

However, given the nature of "Internet weather," one second per update is pretty aggressive for that approach.

您可以考虑使用Silverlight.这样,您将拥有更多的控制权,并且可以最大程度地减少需要通过网络传输的数据量.实际上,您可以对原始TCP连接使用长时间轮询,以进一步提高可伸缩性.

You might instead consider using Silverlight. You would have much more control that way, and could minimize the amount of data that needs to go over the wire. In fact, you could use long polling with raw TCP connections, to further increase scalability.

这篇关于如何每秒从数据库更新一次?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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