如何减少DataGridView中绑定大数据的时间。 [英] How to reduce time for Binding Large Data in DataGridView.

查看:206
本文介绍了如何减少DataGridView中绑定大数据的时间。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Friends,我有一个巨大的数据,我想在datagridview中绑定以供查看,但由于数据很大,数据绑定到datagridview的形式会被搁置一段时间,因此用户必须闲置时间。



例如我有500个entires(可能增加到1000的倍数)然后数据需要大约15-20秒才能绑定到datagridview。



有什么方法可以减少这个时间,因为为了绑定相同的我们必须运行 foreach()循环到存在的条目的数量?



谢谢提前

Hello Friends, I have a huge data which i want to bind in datagridview for view purpose but as the data is large the form on which the data gets bind to datagridview gets hanged for sometime and hence the user have to sit idle for the time.

E.g. I have 500 entires (may increase unto multiples of 1000) then it takes around 15-20 seconds for the data to get bind to datagridview.

Is there any way to reduce this time because in order to bind the same we have to run a foreach() loop unto the no of entries present?

Thanks in advance

推荐答案

如果您的客户端需要一次点击中的所有数据并且仍然有来自应用程序的响应那么我想到的唯一方法就是多线程。 br />


将数据加载到应用程序线程以外的线程中。



这里 [ ^ ]是一些初步阅读,以防您不熟悉该主题。我不得不说我从来没有真正令人满意地工作,虽然我只是尝试了,而不是真的。



祝你好运! :)
If your client requires all data in one hit and to still have response from the application then the only methodology that springs to mind is multi-threading.

Load the data in a thread other than the application thread.

Here[^] is some initial reading, in case you are not familiar with the subject. I have to say that I have never really got this to work satisfactorily, although I was only trying it out, not doing it for real.

Good luck! :)


在VirtualMode中使用DataGridView分页数据 [ ^ ]可能会有所帮助。



在同一主题的MSDN上还有一大部分。



祝你好运! :)
Paging Data with DataGridView in VirtualMode[^] might help.

There is also a large section on MSDN on the same subject.

Good Luck! :)


我认为你应该通过编写正确的选择查询来限制从数据库中提取的行数[set rowcount]。

进一步研究:

http://www.devx.com/getHelpOn/10MinuteSolution/20564
I think you should restrict the number of rows[ set rowcount] to be fetched from the database by writing proper select queries.
For further study:
http://www.devx.com/getHelpOn/10MinuteSolution/20564


这篇关于如何减少DataGridView中绑定大数据的时间。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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