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 dll handles the request of .aspx page?

557


What is a ashx file?

550


What are server objects?

511


What are the difference between overriding and overloading?

496


6. Tell us about a time when you failed to meet a deadline. What were the repercussions?

1721






What is different authentication mechanisms used in ASP.NET?

577


What are the asp.net security controls?

546


How to send a DataReader as a parameter to a remote client ?

2713


What is the significance of attaching a profile while creating a user?

559


Explain cookies with example.

551


What is enableviewstate?

532


What is the biggest disadvantage of “Other Return Types” in Web API?

924


Explain serialization and deserialization?

542


If 200 is for all successful operation then why do we have 201 response codes?

521


3. What goals do you have in your career?

1416