How do you implement Paging in .Net ?

Answer Posted / gitam singh

The DataGrid provides the means to display a group of records from the data source (for example, the first 10), and then navigate to the "page" containing the next 10 records, and so on through the data.
Using Ado.Net we can explicit control over the number of records returned from the data source, as well as how much data is to be cached locally in the DataSet.
1.Using DataAdapter.fill method give the value of 'Maxrecords' parameter
(Note: - Don't use it because query will return all records but fill the dataset based on value of 'maxrecords' parameter).
2.For SQL server database, combines a WHERE clause and a ORDER BY clause with TOP predicate.
3.If Data does not change often just cache records locally in DataSet and just take some records from the DataSet to display.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which object encapsulates state or data of a user?

840


What is a query string in a url?

745


What are the advantages and limitations of query string?

805


Explain about secure socket layer?

718


What is the difference between rest and restful?

778


What is the basic difference between asp and asp.net?

742


Fetch one page value to another page without using state-managment ?

703


When Cookies are expired in ASP.NET?

775


What is difference between asp.net and asp?

760


What is paging in context of Memory?

871


What are the ways to sending the data in ASP.NET page?

749


What is page fragment caching?

723


What is an example of an application service provider?

650


What is web api vs wcf?

782


Types of instancing properties and explain each. Tell the difference between multiuse,singleuse and globalmultiuse and which is default ?

2512