Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
You can use Web service methods to create a secondary data source that populate drop-down lists. Creating a secondary data source from a Web method with the Data Connection Wizard is similar to the process you used for database tables and queries in the section “Creating Secondary Data Sources for List Boxes,” in Chapter 13.
The NWOrdersWS service has five Web methods designed for secondary data source use: GetCustomers, GetProducts, GetProductsDetailed, GetShippers, GetEmployees, and GetLast10Orders. All but the GetLast10Orders method return a serialized object; GetLast10Orders returns an array of integers. A drop-down list of the last 10 orders added to the database is useful to populate a list box that aids in guessing the OrderID value of records you insert in the database. Guesswork is required because the secondary data sources load when you open the form, so newly added orders don’t appear in the list unless you close and reopen the form. Updating the form with an added Orders record that displays the correct Order ID text box values requires adding code.