Business Logic Framework - Tutorial 39:
This tutorial shows you can use Take and Skip methods to tell the business object that you would like to select a certain portion of the records from the database rather than the entire set. It is same as setting the StartRowIndex and PageSize properties.
| using (Customers customers = new Customers()) |
| { |
| var result = (from c in customers |
| where c.CustomerID > 1 |
| select c).Skip(1).Take(2); |
| foreach (var v in result) |
| { |
| this.AddLabels(v.FirstName, v.LastName); |
| } |
| } |
| Using customers As Customers = New Customers() |
| Dim result = (From c In customers _ |
| Where (c.CustomerID.Value > 1) _ |
| Select c).Skip(1).Take(2) |
| For Each v In result |
| Me.AddLabels(v.FirstName, v.LastName) |
| Next |
| End Using |
