与 MS Access Grid 相比,Winform DataGridview 非常慢 [英] Winform DataGridview incredibly slow compared to MS Access Grid

查看:36
本文介绍了与 MS Access Grid 相比,Winform DataGridview 非常慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我通过 ODBC 连接到带有 MS ACCESS 的 100000 行的 Oracle 数据库时,我可以立即看到结果并在 1 秒内到达记录的末尾.

When I connect to an Oracle Database though ODBC with 100000 rows with MS ACCESS, I can see results instantly and go to the end of the records in 1 seconds.

用 ADO.NET 和 Winform Datagridview 做同样的事情非常慢,需要几十秒!!!

Doing the same thing with ADO.NET and the Winform Datagridview is incredibly slow it takes dozens of seconds !!!

如何获得与 MS Access Gridview 相同的速度?我找不到任何现成的代码来执行此操作.

How to get the same speed as MS Access Gridview ? I can't find any ready-to-use code to do so.

推荐答案

我想您是在一次将所有行绑定到 DataGridview,而绘制需要很长时间.

I suppose you're binding all rows to the DataGridview at once and it's the drawing that takes a long time.

如果您只想显示数据,则可以非常轻松地实现虚拟模式.只需实现 CellValueNeeded 事件.在虚拟模式下,网格仅检索显示所需的行.

If all you want is to display data, you can very easily implement Virtual Mode. All it takes is to implement the CellValueNeeded event. In Virtual Mode, the grid retreives only the rows needed for display.

也可以实现 DataGridView 可以提供的所有操作,但可能需要大量代码.

It's also possible to implement all the operations a DataGridView can offer but it can take a lot of code.

看一看:Windows Forms DataGridView控件中的虚拟模式

这篇关于与 MS Access Grid 相比,Winform DataGridview 非常慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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