473,748 Members | 9,931 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

GridView sorting paging : perform in db ?

In regard to a GridView that must support searching, filtering, sorting, and
paging ...

There is a tradeoff in performing the sorting and paging in the database
versus to creating a CLR sort expression and allowing the GridView to
perform the sorting and paging.

How do people feel about each option for

(1) simple sorts (alphabetical, compound alphabetical)

(2) complex sorts (derived attributes, date-time manipulations, etc.)
Mar 27 '08 #1
1 1959
It really depends on how many rows you have in the resultset that will be
paged.
If it is a manageable number. you can cache the results and simply rebind
the datasource based on the current page of results. If it is a very large
number of rows, this becomes inefficient because of the large number of
results and you'll be better off using custom paging via SQL RowNumber or
similar techniques. A simple google search on "Gridview Custom Paging" will
provide some good samples to study.
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short Urls & more: http://ittyurl.net
"John A Grandy" wrote:
In regard to a GridView that must support searching, filtering, sorting, and
paging ...

There is a tradeoff in performing the sorting and paging in the database
versus to creating a CLR sort expression and allowing the GridView to
perform the sorting and paging.

How do people feel about each option for

(1) simple sorts (alphabetical, compound alphabetical)

(2) complex sorts (derived attributes, date-time manipulations, etc.)
Mar 28 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2733
by: ck388 | last post by:
For some reason when I enable the callback feature of the gridview I still get a page refresh, that is it seems like there is a postback that occurs, not a callback which is just supposed to update not the whole page, but a portion of the page. Strangely enough the URL below http://beta.asp.net/QUICKSTARTV20/aspnet/doc/ctrlref/data/gridview.aspx (VB GridView Paging and Sorting Callbacks example)
4
2625
by: Bishop | last post by:
I want to find out if there is a way to use the gridview to list products simular to the listing on this page: http://www.amazon.com/gp/search/103-7922422-8587868?&node=1045744&field-pctoffbin=50%25%20-%2070%25%20off I'm guessing this may be better suited for a datalist but I am much more famular with the gridview that I'd like to find out if I can use that first. Also I like the built in paging and sorting that the gridview offers.
5
3376
by: yefei | last post by:
In my web design, I display records from a SQL DataBase according to some filters the GridView is defined with select commands and selest parameters however, I also want to display all records in the database when the user press a "View All" button. In this case, I need to change the select comand and clear the parameters. And I did this in the button_click() event. the GridView can display desired results when I press the "View All"...
3
2192
by: Marc Grutte | last post by:
Hi I am trying to bind a custom datasource to a gridview whilst paging is enabled. What is missing in this code to make the paging + binding work? thanks M <%@ Page Language="VB" %>
3
1560
by: Toni | last post by:
In DataGrid and GridView I can't use paging and sorting. I am connected to database with code, not visual. Can I use paging and sorting if I populate data to grid with code, or I need to drag and drop connection, dataset, datatable etc.
1
1814
by: mmorrison93 | last post by:
I've created my own custom gridview that derives from the System.Web.UI.WebControls.GridView class and am trying to implement my own sorting and paging mechanisms. The GridView class has two private variables SortExpressionInternal, SortDirectionInternal tat I'd like to set to specific values, however because the variables are private i'm not able to access them. Does anyone know of a way to access these variables from my derived class and...
0
1531
by: Sobin Thomas | last post by:
Hi All, How can I bind the Gridview control to Sql Datasource control on a button click(I see majority of the articles binding datasource at page load) I need to enable the paging and sorting of the Gridview control also .Actually I am able to bind the sql datasource control to the Gridview on button Click but on clicking the GridView for paging or sorting , the Gridview vanishes!! In short, I want to bind the GridView control to a...
1
2021
by: Sobin Thomas | last post by:
Hi All, How can I bind the Gridview control to Sql Datasource control on a button click(I see majority of the articles binding datasource at page load) I need to enable the paging and sorting of the Gridview control also .Actually I am able to bind the sql datasource control to the Gridview on button Click but on clicking the GridView for paging or sorting , the Gridview vanishes!! In short, I want to bind the GridView control to a...
0
1348
by: =?Utf-8?B?R3JlZw==?= | last post by:
I've been playing around with the GridView and for the most part am able to achieve most of what I need to. I am having just one problem and that's with the Sorting and Paging options. If I use a <asp:sqlDataSourcesorting and paging work fine, but when I popluate the GridView via a DataSet via Code-Behind, the sorting and paging do not work at all. I don't want to use sqlDataSource because my DataSets will be creating using Stored...
0
8991
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8831
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9548
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9374
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9249
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8244
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6076
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4607
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.