Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: SQL-server-2005 .NET3.5 LINQ , +
Hello Guys,
 
I heard that Linq to SQL can perform paging.
But which is the efficient way of doing a paging?
 
* SqlDataSource (caching)
* Linq
* Custom Paging (SQL-sproc)
 
Comparison for both initial loading and postback.
Assuming that the number of data in db is 1Million.
 
Suggestions are very much appreciated.
Posted 1-Mar-12 7:23am
Edited 2-Mar-12 23:37pm
thatraja239.2K
v2
Comments
thatraja at 3-Mar-12 5:35am
   
Nice question, Counter 5!
deepakaitr12345 at 2-Apr-12 7:14am
   
I think you should go for the state management for this like session,viewstate
you would get more on this related to performance.
 
Thanks
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hey,
 
You should use "Custom Paging (SQL-sproc)" create a SP which takes param for Page number, PageSize.
 
use the row number into u'r Sql Query to get the records from Page Number and Size.
 

Looking forward for your response.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

No doubt at all it is custom paging.
 

Comparing the Performance of Default and Custom Paging
 
Since custom paging only retrieves the needed records, whereas default paging returns all of the records for each page being viewed, it s clear that custom paging is more efficient than default paging. But just how much more efficient is custom paging? What sort of performance gains can be seen by moving from default paging to custom paging?
 
Unfortunately, there s no one size fits all answer here. The performance gain depends on a number of factors, the most prominent two being the number of records being paged through and the load placed on the database server and communication channels between the web server and database server. For small tables with just a few dozen records, the performance difference may be negligible. For large tables, with thousands to hundreds of thousands of rows, though, the performance difference is acute.
 

 
for more details look at this link for Efficiently Paging Through Large Amounts of Data
 
http://www.asp.net/web-forms/tutorials/data-access/paging-and-sorting/efficiently-paging-through-large-amounts-of-data-cs[^]
 
Thanks,
SP
  Permalink  
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 210
1 Richard MacCutchan 100
2 kbrandwijk 90
3 ProgramFOX 80
4 Sandeep Singh Shekhawat 70
0 Sergey Alexandrovich Kryukov 9,050
1 OriginalGriff 8,151
2 CPallini 2,613
3 Richard MacCutchan 2,221
4 Abhinav S 1,928


Advertise | Privacy | Mobile
Web04 | 2.8.140827.1 | Last Updated 17 Apr 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100