This lesson assumes you have completed all preceding lessons. See Lesson 1: Compiling the CustdbScripts.dll assembly with MobiLink references.
UltraLite comes with a sample Windows client that automatically invokes the dbmlsync utility when the user initiates synchronization. In this lesson, you run the application against the CustDB consolidated database you started in the previous lesson. You enter a new customer name and order details. During a subsequent synchronization, this information is uploaded to the CustDB consolidated database and the upload_insert and download_cursor events for the ULCustomer table triggers.
Start the sample application.
Click Start » Programs » SQL Anywhere 12 » UltraLite » Windows Sample Application.
Enter an employee ID and synchronize.
Enter a value of 50 for the employee ID, and click OK.
The application automatically synchronizes, and a set of customers, products, and orders is downloaded to the application from the CustDB consolidated database.
Click Order » New.
Enter Frank DotNET for a customer name.
Choose a product, and enter the quantity and discount.
Click OK to add the new order.
You have now modified the data in your local UltraLite database. This data is not shared with the consolidated database until you synchronize.
Click File » Synchronize.
A message indicating that the insert was successfully uploaded to the consolidated database appears.
You can use Interactive SQL to verify that the sample database downloaded new customer data from the sample application.
Connect to the sample database from Interactive SQL:
Click Start » Programs » SQL Anywhere 12 » Administration Tools » Interactive SQL, or run the following command:
Click ODBC Data Source Name and type SQL Anywhere 12 CustDB.
Execute the following SQL statement in Interactive SQL:
SELECT * FROM ULCustomer WHERE cust_name = 'Frank DotNET';
The query results appear in the lower pane of Interactive SQL, which displays the customer ID, name, and last modified fields. The last modified field indicates when the Frank DotNET customer was last updated. The field should indicate the date and time when you synchronized the sample application with the consolidated database.
Proceed to Cleaning up.
Discuss this page in DocCommentXchange.
|Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1|