473,669 Members | 2,514 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Gridview paging and SELECT with no Where clause

Hello,

I wonder whether someone can explain to me how data is fetched from a
database server when using ASP.NET 2.0's gridview with paging enabled?
My SQL DataSource has a simple "select * from customers" - no where
clause. Using SQL Server's Profiler I can see this same statement is
executed each time I move between pages. Am I right that the ASP
engine on the server is just returning the records required for that
particular page in the grid?

For example - if the grid wants to display relative records 10 thru 19
(say page 2) it still runs select * causing the server to retrieve the
entire table, but only records 10 thru 19 are returned to the
browser?

If this is correct, then after page 2 is rendered to the browser, if a
second user changes record 20 (part of what would be the first user's
3rd page), when the first user requests the third page (records 20
thru 29), then this first user will see the second user's change to
record number 20?

Thanks in advance,

Ray
Mar 17 '08 #1
1 2289
you are correct. the default paging is bind to a dataset, and display record
n thru n + page size. if your table is very large, this is not a good
approach. you want to handle the paging in your code.

-- bruce (sqlwork.com)
"rbrowning1 958" wrote:
Hello,

I wonder whether someone can explain to me how data is fetched from a
database server when using ASP.NET 2.0's gridview with paging enabled?
My SQL DataSource has a simple "select * from customers" - no where
clause. Using SQL Server's Profiler I can see this same statement is
executed each time I move between pages. Am I right that the ASP
engine on the server is just returning the records required for that
particular page in the grid?

For example - if the grid wants to display relative records 10 thru 19
(say page 2) it still runs select * causing the server to retrieve the
entire table, but only records 10 thru 19 are returned to the
browser?

If this is correct, then after page 2 is rendered to the browser, if a
second user changes record 20 (part of what would be the first user's
3rd page), when the first user requests the third page (records 20
thru 29), then this first user will see the second user's change to
record number 20?

Thanks in advance,

Ray
Mar 17 '08 #2

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

Similar topics

0
2727
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)
2
2216
by: asad | last post by:
Hello friends, i am designing a ASP.NET page where i want to use custom paging bcoz data is too heavy so pls tell me how can i use custom paging in ASP.NET Thanks
1
6507
by: Henry Habermacher [MVP Access] | last post by:
Environment: VS2005, ASP.Net 2.0, SQLServer 2000, VB.Net, IIS6 I use a GridView Control which is based on a SQLDataSource. The datasource is based on a Select statement and is filtered by the FilterExpression. The GridView also has a pager element (below, displaying first, previous, next, last icons), paging is enabled, page contains 10 rows. The user now skips some pages by clicking a view times on the next icon. Now he changes the...
4
7337
by: Bishop | last post by:
I have a number of simple select queries that a user needs to be able to execute and display the data on the screen in a gridview. My thought was that I could use a Gridview set to dymanically generate columns and bound to a SQLDataSource. Then the user can click buttons (or whatever) and it changes the SelectCommand property of the SQLDataSource and re-binds the GridView. That worked great until I enabled paging. When paging is...
0
2410
by: John Smith | last post by:
ASP.Net 2.0 / C# / IIS 6 I have 2 pages. The master page consists of a tabbed menu created using the Menu and MultiView controls. Something like this: http://fredrik.nsquared2.com/viewpost.aspx?PostID=344&showfeedback=true The second page is a user control that contains a GridView control linked to a database table. What's supposed to happen is that the user clicks on a menu choice and an appropriate user control will load. For...
8
2797
by: rbg | last post by:
I did use query plans to find out more. ( Please see the thread BELOW) I have a question on this, if someone can help me with that it will be great. In my SQL query that selects data from table, I have a where clause which states : where PermitID like @WorkType order by WorkStart DESC
2
13180
by: antonyliu2002 | last post by:
I've been googling for some time, and could not find the solution to this problem. I am testing the paging feature of gridview. I have a very simple web form on which the user can select a few fields to be included in the table, which is to be bound to the gridview. The web form looks like so (Don't worry about the stupidity of this web form for now.):
0
2001
by: Don Miller | last post by:
Here is an example of what I believe is a bug in ASP.NET 2.0 GridView paging without postbacks (or at least not documented how to fix it). Once the GridView is displayed, clicking on any of the paging tools causes the GridView to completely disappear! This happens when either DataSets or DataTables are used (it doesn't work at all for DataReaders because they don't support paging apparently). If you remove the...
4
2720
by: Don Miller | last post by:
This is a repost of a reproducible problem/bug with GridView with dynamic SQL and binding. Is there a better ASP.NET newsgroup I should post to where MS techs or MVPs take an interest in such problems? Thanks. Here is an example of what I believe is a bug in ASP.NET 2.0 GridView paging without postbacks (or at least not documented how to fix it). Once the GridView is displayed, clicking on any of the paging tools causes the
0
8466
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
8896
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
8810
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
8659
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...
1
6211
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5683
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
4208
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...
1
2798
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2035
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.