在datagridview中加载数据集的最快方法? [英] fastest method to load a dataset in a datagridview ?

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

问题描述

我大约有1.000.000数据行,我使用缓冲流和线程将它们快速加载到数据集中...

现在可以通过非常快速的方法将数据集"加载到数据网格视图"中:如何做?

感谢任何帮助.

i have about 1.000.000 datarows, i load them fastly to a dataset using bufferstream and threading...

now to load the ''dataset'' in a ''datagridview'' by a very fastmethod : How to do ?

thank''s for any help

推荐答案

要使大型数据集与DataGridView一起使用,您需要将其置于虚拟模式.根据我的经验,在这种情况下,大"意味着超过10,000.

此处开始 [
To make a large data set work with the DataGridView, you need to put it into virtual mode. ''Large'' in this case means over about 10,000, in my experience.

Start your research here[^].


总之不要说
. 您不应该在视图中需要太多行,因为这仅意味着您的可怜用户将不得不在视图尝试刷新自身的同时坐着几个小时来摆弄他或她的拇指.使用来自用户的输入信息从数据库中选择适当的记录(基于视图的可见部分的大小),然后将其放入数据集中.当用户需要查看一些其他数据时,请重复该操作.您可以通过在后台线程中运行数据库访问来进一步提高性能.
In a word DON''T.
You should never need that many rows in your view as it will just mean that your poor user will have to sit twiddling his or her thumbs for hours while your view tries to refresh itself. Use the input information from the user to select the appropriate records from the database (based on the size of the visible portion of your view) and put those in the dataset. When the user needs to see some different data you repeat that operation. you can improve the performance even further by running your database accesses in a background thread.


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

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