Reputation: 655
In Visual Studio 2012. I created a query it limits the amount of rows to 10. How do I set this query for the DataView Grid so it only loads this query on start of the application instead of loading the entire database which is several thousands of rows?
This is a Microsoft SQL database.
Upvotes: 0
Views: 240
Reputation: 6656
First-of-all its better if you post some code sample, so that we can help you out properly. Also mention which version of sql server you are using.
Anyways...
You have to use paging for that. Now its upto you that how you gonna implement it. If you wants to do it using SQL Server then here below is the link in which they using CTE (Common Table Expression).
http://sqlserverplanet.com/design/pagination-using-rownumber
Upvotes: 1