如何在mvc4的webgrid中显示100万条记录? [英] How to show 1 million records in webgrid at mvc4?

查看:87
本文介绍了如何在mvc4的webgrid中显示100万条记录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个包含100万条记录的表如何将所有记录绑定到我的MVC4应用程序中的webgrid,我正在使用实体框架和wcf服务来实现我的mvc应用程序?

Hi,
I am having a table with 1 million record how to bind all the records to webgrid in my MVC4 Application, I am using Entity Framework with wcf service for my mvc application ??

推荐答案

您不想一次显示所有记录。这将需要永远,浏览器可能会耗尽内存......你将不得不使用分页和显示说2000页的500条记录。



它没有在客户端/服务器架构中同时显示超过几千条记录是很有意义的,因为有太多的数据传输。



嗯,可能有一个解决方案。 ..使用支持虚拟化的网格控件,只加载显示数据周围的记录。为此,你通常需要像某种jQuery网格一样的客户端控制...



如果你想允许排序,那么你还需要索引这些大数据的数据库级别,以便您可以在合理的时间内获得所需的数据。



非常大的网格通常被认为是一个糟糕的设计。在一百万条记录中很难在特定位置导航,因为滚动条不精确(它可以为每个移动像素移动数千条记录)或者如果一次移动一页则非常慢(假设有50条可见记录,则需要每千条记录20次按键)
You don't want to display all record at once. It would take forever and the browser might run out of memory... You'll have to use paging and display say 2000 pages of 500 records.

It does not make much sense to display more than a few thousand records at once in client/server architecture as there is too much data transfert.

Well, there might be a solution... use a grid control that supports virtualization and only load records around displayed data. For that, you will typically need client-side control like some kind of jQuery grid...

If you want to allows sorting, then you would also need indexes at the database level for such large data so that you can get only the required data in a reasonable amount of time.

Very large grid a generally considered as a bad design. At one million record it is very hard to navigate at a specific location as scrollabar are imprecise (it can move thousand of record for each pixel of movement) or very slow if you move one page at a time (assuming 50 visible records, it take 20 key press per thousand records)


这篇关于如何在mvc4的webgrid中显示100万条记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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