Gridview的Databind非常慢 [英] Gridview Databind Very Slow
问题描述
Am使用asp.net gridview少量的数据加载到网格不是问题,但是大量的数据加载到网格却遇到了速度问题.如何避免?
Am Using asp.net gridview small amount of data load to grid is not a problem but bulk amount of data load to grid i facing slowness issue. how to avoid ?
我正在使用sqldataadapter并填充到datatable并绑定到gridview
and i am using sqldataadapter and fill to datatable and bind to gridview
推荐答案
我在返回约9000行的数据源访问存储过程时遇到了这个问题. sproc运行速度很快,但是在将数据绑定到gridview时运行速度会很慢.
I had this problem returning about 9000 rows with a datasource accessing a stored procedure. The sproc runs fast, but would run slow when it was databound to a gridview.
我删除了存储过程中的order by
子句,它的显示速度很快.显然,网格希望自己进行排序.
I removed the order by
clause in the stored procedure and it's lighting fast. Eveidently the grid wants to do it's own ordering.
这篇关于Gridview的Databind非常慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!