How do you implement Paging in .Net ?



How do you implement Paging in .Net ?..

Answer / 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

More ASP.NET Interview Questions

How can we prevent an aspx page get refreshed when any information fetch from the database ?

2 Answers   Minecode,


What was the difference between machine.config and web.config files

17 Answers   Assurgent, NIIT, TCS,


what is client-server architecture in .net? and what is 3-tier architecture?

1 Answers  


What are the features of asp.net mvc?

0 Answers  


What is a swagger in web api?

0 Answers  


Explain the Order of events in an asp.net page?

0 Answers  


asp.net interview questions

0 Answers  


What is the main difference between Asp.net and Vb.net?

0 Answers  


What is the difference between Session and response.Redirect?

0 Answers   Microsoft,


How many Directives r in ASP.NET?

8 Answers  


what is service contract,operation contract?

2 Answers  


how to get modified rows from Dataset

1 Answers   CGI,


Categories