ASP.NET GridView中优化的分页和排序 [英] Optimized Paging and Sorting in ASP.NET GridView

查看:76
本文介绍了ASP.NET GridView中优化的分页和排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何优化Query以便大量数据可以运行Smoothly.Current它无法处理如此庞大的数据。

解决方案

基本优化技巧,



SQL

 1)创建表时使用正确的索引
2)在获得结果时调用多个表时使用正确的连接。
3)使用特定列,而不是调用选择列表中的所有列。
4)避免聚合函数和分组子句。
5)避免使用临时表声明而不是使用表变量。
6)如果数据很大,请使用SQL进行分页。





页面

 1)不要在加载事件中加载数据,而是执行一些操作并对其进行过滤。 
2)使用默认过滤器选项检索数据。
3)删除不必要的代码逻辑。
4)删除不必要的迭代。
5)使用轻量控制。
6)如果数据量很大,而不是在编码方面进行分页,那么最好在数据库方面进行。
7)尽量避免使用RowDatabound事件,如果你使用DataSource控件,这将在每一行上执行。





以上步骤是优化页面的基本和常用步骤,除了你需要更专注于服务器性能等...



希望这会对你有所帮助你


how i can optimzed the Query so that huge amount of data can Run Smoothly.Current It is not able to handle such huge data.

解决方案

The basic optimization techniques,

SQL

1) Use proper Indexes while creating tables
2) Use proper joins when you call multiple tables while getting result.
3) Use specific columns, instead of calling all the columns in select list.
4) Avoid aggregate functions, and Grouping clauses.
5) Avoid temporary table declaration instead of that use table variable.
6) If data is huge, do pagination using SQL.



Page

1) Instead of load data in load event, perform some action and filter it.
2) retrieve data by using default filter options.
3) remove unnecessary code logic's.
4) remove unnecessary iterations.
5) use light weight controls.
6) If data is huge, instead of doing pagination in coding side, better to do it in database side.
7) Try to avoid RowDatabound event, if you are using DataSource control, this will execute on each and every row.



The above steps are basic and common steps to optimize the page, apart from that you need to concentrate more like server performance etc...

Hope this will helpful to you.


这篇关于ASP.NET GridView中优化的分页和排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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