Fetch
Purpose
This demo shows how to fetch paged orders and also master/detail via single
server call. See the
DA04
article for a discussion on Dynamic Method Binding using this
sample as its example.
Getting Started
When you compile and run both projects you will see the client present you
with two tabbed pages:
-
Paged Orders: when the master dataset ("Orders") is opened,
the first 40 records are fetched from the server (assuming that you haven't
modified the Max Records Per Fetch setting). Try clicking on the vertical
scrollbar.
Initially, you will be displaying the other records fetched when the dataset
was opened. Once you have reached record 40, another batch of records are then
fetched from the server and you can see when this happens because the scrollbar
thumb reduces size.
OrderDetail records are only fetched as required.
-
Fetch All: retrieves all orders within the range specified. All
associated OrderDetail records are retrieved also.
Examine the Code
The following methods are worth examining:
-
GetOrdersAndDetails in FetchService_Impl: called by the Fetch
All page and it shows how to retrieve master and detail records in a single
server call.
-
tbl_PagedOrdersAfterScroll in FetchClientMain: holds the paging logic.