将大数据集加载到 GridView 的最快方法是什么? [英] What is the fastest way to load a big data set into a GridView?

查看:35
本文介绍了将大数据集加载到 GridView 的最快方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个数据源,其中包含 1.4 多万行,并且还在增长.

I have a data source with 1.4+ millions rows in it, and growing.

我们让用户添加过滤器来减少被调用的数据,但您仍然一次查看 43,000 +/- 到 100,000 +/- 行.

We make the users add filters to cut the called data down, but you are still looking at 43,000+/- to 100,000 +/- rows at a time.

在任何人说之前,反正没有人可以看到这么多行,它们被导出到一个excel工作簿中进行基于它们的计算.

Before any one says, no one can look at that many rows anyway, they are exported to a excel workbook for calculations based on them.

我正在从返回的 CSV 文件在 GridView 中加载结果如下:

I am loading the result as follows in the GridView from the CSV file that is returned:

Object result = URIService.data;
CSVReader csvReader = new CSVReader(result);
DataTable dataTable = csvReader.CreateDataTable(true, true);

If(dataTable != null)
{
    gridView1.BeginUpdate();
    gridView1.DataSource = dataTable;
    gridView1.DataBind()
    gridView1.EndUpdate();
}
Else
{
    Return;
}

CSVReader 是一个 CSV 解析器.

CSVReader is a CSV Parser.

我的问题是,这是将大型数据集加载到 gridview 的最佳和最有效的方法吗?

My question is, is this the best and most efficient way to load a large data set to a gridview?

使用行列表或数据表以外的其他东西会更好吗?

Would using a list for the rows or something other than a data table be better?

推荐答案

我认为只有一种方法可以将大型数据集加载到 grid-view 中,而这正是您现在正在使用的方法,但是如果您想使性能更好我强烈建议使用分页,这样你就可以在每个页面上加载大量数据,从而减少加载时间

I think there is only one way to load the large data set into grid-view and it is the one you are using right now, but if you want to make the performance better I highly recommend using pagination so you have chunks of data loaded on every page therefore you will decrease the loading time

http://sivanandareddyg.blogspot.com/2011/11/efficient-server-side-paging-with.html

http://www.codeproject.com/Articles/125541/Effective-Paging-with-GridView-Control-in-ASP-NET

http://www.4guysfromrolla.com/articles/031506-1.aspx

这篇关于将大数据集加载到 GridView 的最快方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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