Dela via


Occasionally Connected Applications (Devices)

An occasionally connected application uses data from a remote database if it has access to that database: otherwise, it uses data stored in a local cache. When a connection is available, occasionally connected applications synchronize the data stored in the local cache with the data stored in the remote database. Thus, users of occasionally connected smart device applications can continue to use their application, even if a network connection is unavailable.

Given that mobile devices often move in and out of network coverage, occasionally connected applications offer an important benefit. For example, consider an existing sales force application that cannot be used in a disconnected state. Suppose that it provides product information and takes orders. If its data access is suddenly interrupted, the field sales representatives who rely on it will be unable to use it.

You can easily modify applications that use the ADO.NET programming model to support occasional connectivity. To do this, use the Synchronization Services framework that is built into Visual Studio 2008 Service Pack 1. After the modifications, sales representatives can access products and order data locally on their mobile device by using either DataSet or System.Data.SqlServerCe.SqlCeResultSet objects. Their application will synchronize the local SQL Server Compact database with the remote database whenever a network connection is available.

To create an occasionally connected smart device application, you use the same synchronization designer that you use to develop synchronized desktop applications. For an overview of the synchronization designer, see Occasionally Connected Applications Overview and How to: Configure Data Synchronization in an Application. For step-by-step instructions about how to create an occasionally connected smart device application, see Walkthrough: Creating an Occasionally Connected Smart Device Application.

Developing for Smart Devices Rather than the Desktop

The following limitations apply if you are developing occasionally connected applications for smart devices.

  • Microsoft Synchronization Services for ADO.NET (Devices) version 1.0 supports devices that run Windows CE 5.0, Windows Mobile 5.0, and Windows Mobile 6. Devices that run Windows Mobile 2003, Windows CE 4.2, and earlier operating systems are not supported.

  • You must manually download and install Microsoft Synchronization Services for ADO.NET v1 SP1 (Devices). Unlike the desktop version of Microsoft Synchronization Services for ADO.NET, the device version is not installed with Visual Studio 2008 or SQL Server Compact 3.5.

  • You must manually download and install Microsoft SQL Server Compact 3.5 Service Pack 1 for Windows Mobile. Microsoft Synchronization Services require Microsoft SQL Server Compact 3.5 SP1.

  • You must install Visual Studio 2008 Service Pack 1.

  • Synchronization Services for ADO.NET (Devices) version 1.0 works with device applications that target the .NET Compact Framework version 2.0 or later. Native applications are not supported.

  • Synchronization Services for ADO.NET (Devices) does not support 2-tier synchronization. Therefore, device applications that use Synchronization Services cannot synchronize directly with a remote database. Instead, the device must use n-tier architecture and synchronize through a Windows Communication Foundation (WCF) or Web service.

  • In smart device projects, the synchronization designer cannot be started from the Data Source Configuration Wizard.

  • When you deploy a synchronization enabled device application from the Visual Studio IDE, Synchronization Services CAB files are automatically deployed and installed on the target device or emulator. You do not have to manually install Synchronization Services CAB files on the device.

Installing the Synchronization Services API and Getting Help

By default, Synchronization Services documentation is not installed. It will be available only if Help is configured for online use. To install Synchronization Services documentation for local use, you must first download the Help collection from the Microsoft Synchronization Services for ADO.NET Books Online Web site. For online reference information, see Overview (Synchronization Services).

See Also

Tasks

Walkthrough: Creating an Occasionally Connected Smart Device Application

How to: Configure Data Synchronization in an Application

Concepts

Using SQL Server Compact 3.5 Databases (Devices)

Occasionally Connected Applications Overview

Change History

Date

History

Reason

July 2008

Added topic.

SP1 feature change.