Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 12.0.1 » MobiLink - Getting Started » MobiLink tutorials » Tutorial: Using .NET synchronization logic


Lesson 6: Testing synchronization

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 and test authentication
  1. Start the sample application.

    Click Start » Programs » SQL Anywhere 12 » UltraLite » Windows Sample Application.

  2. 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.

  3. Click Order » New.

  4. Enter Frank DotNET for a customer name.

  5. Choose a product, and enter the quantity and discount.

  6. 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.

  7. 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.

  8. Connect to the sample database from Interactive SQL:

    1. Click Start » Programs » SQL Anywhere 12 » Administration Tools » Interactive SQL, or run the following command:

    2. Click ODBC Data Source Name and type SQL Anywhere 12 CustDB.

    3. Click Connect.

  9. 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.

  10. Proceed to Cleaning up.

 See also