在gridview中加载数据非常慢。 [英] Loading data inside gridview is very slow .

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

问题描述


我在sql server table中有10000条记录。我在页面加载期间使用asp.net加载了gridview,c#

但加载数据需要更多时间。

请帮我解决问题

谢谢和问候

Chandran

解决方案

你可以转到SQL Server中的分页。



这可能是有用的链接

http://blog.sqlauthority.com/2013/ 04/14 / sql-server-tricks-for-row-offset-and-paging-in-various-versions-of-sql-server / [ ^ ]

为什么呢?一次有数百万条记录?这不是一个好方法。



在显示数据时使用分页/过滤。



在数据库方面

SQL Server 2005分页结果 [ ^ ]



In前端

GridView多重过滤器AJAX控件 [ ^ ]

重复分页和分页功能 [ ^ ]



查看本系列的数据库优化

优化SQL Server中数据访问的十大步骤:第一部分(使用索引) [ ^ ]

在SQL Server中优化数据访问的十大步骤:第二部分(重新考虑TSQL并应用最佳实践) [ ^ ]

优化SQL Server中数据访问的十大步骤:第III部分(应用高级索引和非规范化) [ ^ ]

返回顶部在SQL Server中优化数据访问的10个步骤:第IV部分(诊断数据库性能ormance问题) [ ^ ]

在SQL Server中优化数据访问的十大步骤:第五部分(优化数据库文件并应用分区) [ ^ ]


为什么一次加载所有记录?没有人会在页面中看到10,000条记录,对吧?

所以,去寻呼,这样记录就会分成几页。这也是用户友好的。



下一步是,确保在使用后处理数据库连接,否则会使你的应用程序下次运行缓慢并阻塞连接池,将超出限制。



您还可以尝试使用jqGrids或Ajax方法来加载数据。您可以通过在Google或CodeProject上搜索来轻松获取相关文章。但这是你的选择。 :)

Hi I have 10000 records in sql server table.I have loaded in gridview during page load using asp.net,c#
but loading data takes more time.
Please help me to solve the issue
Thanks and regards
Chandran

解决方案

You can go for the Paging in SQL Server.

This may be useful link
http://blog.sqlauthority.com/2013/04/14/sql-server-tricks-for-row-offset-and-paging-in-various-versions-of-sql-server/[^]


Why? Millions of records at a time? That's not a good way.

Use paging/filtering while displaying the data.

In database side
SQL Server 2005 Paging Results[^]

In frontend
GridView Multiple Filter AJAX Control[^]
Repeater with Paging and Sorting Features[^]

Check this series for database optimization
Top 10 steps to optimize data access in SQL Server: Part I (use indexing)[^]
Top 10 steps to optimize data access in SQL Server: Part II (Re-factor TSQL and apply best practices)[^]
Top 10 steps to optimize data access in SQL Server: Part III (Apply advanced indexing and denormalization)[^]
Top 10 steps to optimize data access in SQL Server: Part IV (Diagnose database performance problems)[^]
Top 10 steps to optimize data access in SQL Server: Part V (Optimize database files and apply partitioning)[^]


Why are loading all records at once? Nobody is going to see 10,000 records in a page, right?
So, go for paging, so that records will be divided into pages. That will also be user friendly.

Next thing is, make sure that the Connection to Database is disposed after use, otherwise it would make your application slow next time and block the Connection Pools, which will exceed the limit.

You can also try jqGrids or Ajax methods to load data. You can easily get articles on them by searching on Google or CodeProject. But it is your choice. :)


这篇关于在gridview中加载数据非常慢。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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