473,394 Members | 1,709 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

paging datagrid using stored procedures?

Max
Is it possible or more effecient to use a stored procedure to populate a
datagrid when using datagrid or custom paging? Is it (ADO.NET?) pulling the
entire table into the dataset or is it just pulling the page as defined by
the page size?

I'm assuming that if I use a stored procedure with a datagrid, I won't be
able to use the datagrid's paging anyway, and would have to create my own
code in the stored procedure to return each page of data. Is there any
advantage in doing this?

-Max
Nov 18 '05 #1
2 2225
yeap... you are right....
datagrid does indeed page on the data available... so if you want to page
all you records in a particular table/ view... and if you were to create a
dateview or a dataset and bind it... it will page whatevers available.. (if
your datatable has 1000 records.. it will bind those and then page
accordingly...)
if you just want 10 records it is obviously better to just fetch 10.... and
yes you will have to do the paging on how the rest will be fetched...

other option is to get the full data in dataset/dataview and store it in a
respository like the cache... or session... choice is yours... so that you
dont have to make repeated calls....
asp.net essentially provides you with lots of functionality.. and you have
to work a bit to make it perfect...

--
Regards,

HD

"Max" <ma*****@portvista.com> wrote in message
news:Wu******************@twister.tampabay.rr.com. ..
Is it possible or more effecient to use a stored procedure to populate a
datagrid when using datagrid or custom paging? Is it (ADO.NET?) pulling the entire table into the dataset or is it just pulling the page as defined by
the page size?

I'm assuming that if I use a stored procedure with a datagrid, I won't be
able to use the datagrid's paging anyway, and would have to create my own
code in the stored procedure to return each page of data. Is there any
advantage in doing this?

-Max

Nov 18 '05 #2
Max wrote:
Is it possible or more effecient to use a stored procedure to populate a
datagrid when using datagrid or custom paging? Is it (ADO.NET?) pulling the
entire table into the dataset or is it just pulling the page as defined by
the page size?

I'm assuming that if I use a stored procedure with a datagrid, I won't be
able to use the datagrid's paging anyway, and would have to create my own
code in the stored procedure to return each page of data. Is there any
advantage in doing this?

-Max


Here's a way in old ASP. You could adapt to .NET and return only the
current records to the webserver:

http://www.4guysfromrolla.com/webtech/062899-1.shtml

Yes, if you do any other type of query, etc. using ADO.NET, it pulls all
data meeting the query across.

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
Nov 18 '05 #3

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

Similar topics

0
by: Joseph Walrave | last post by:
I want to create an ASP.NET web application using C#. Purpose of the web application is access to a MS SQL Server database. Some of our customers are using large databases, so the application...
0
by: Jos Walrave | last post by:
I want to create an ASP.NET web application using C#. Purpose of the web application is access to a MS SQL Server database. Some of our customers are using large databases, so the application...
1
by: Guoqi Zheng | last post by:
Sir, The default paging of datagrid is somehow use too much resource, so I am using Stored procedure for the paging. You can find my Stored procedure at the end of this message. It works...
1
by: Patrick.O.Ige | last post by:
I have been paging with DataSet using "DataGridPageChangedEventArgs" and i guess it works with only Dataset because default paging requires that the DataGrid be able to determine the number of...
6
by: Shawn | last post by:
Hi. I already have a datagrid where I'm using paging. I have a stored procedure that fills a temp table with 200-500 rows and then sends back 10 records at the time. When I go to page 2 the SP...
2
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
4
by: news.microsoft.com | last post by:
I've looked in the help and at each of the properties for the grid view, but can't seem to find what I need. I have allowpaging set to true for my gridview and when the page loads I go and fetch...
2
by: rn5a | last post by:
In a shopping cart app, a ASPX page retrieves the order details & personal details of a user from a MS-Access database table depending upon the username of the user. The order details of a...
7
by: =?Utf-8?B?SmVmZiBCZWVt?= | last post by:
The default paging behavior of the gridview doesn't work well with very large sets of data which means we have to implement some sort of custom paging. The examples I have seen (4guysfromrolla,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.