Tools to Help You Develop Applications

备注

The following information is included as reference for existing applications that support offline scenarios only. For developing new applications, please see Architecture and Classes for Database Synchronization.

Microsoft provides the following tools to help you develop synchronization applications:

  • The Local Database Cache and the Configure Data Synchronization dialog box in Visual Studio 2008.

  • The SqlSyncAdapterBuilder class. This is part of the Sync Framework API.

Local Database Cache

Visual Studio 2008 introduces the Local Database Cache. This feature enables you to easily download to a local SQL Server Compact database an initial dataset and later changes to that data. When you add a Local Database Cache, the Configure Data Synchronization dialog box opens. You can use this dialog box to provide specific information about the client and server to set up the required Sync Framework components. For more information, see "Occasionally Connected Applications Overview" in the Visual Studio documentation.

The Local Database Cache provides a great way for you to quickly develop a download-only synchronization application. You can extend the code that is created for the Local Database Cache by adding code that enables uploads (bidirectional synchronization). For more information, see Walkthrough: Extending the Local Database Cache to Support Bidirectional Synchronization.

备注

Visual Studio 2008 uses Sync Framework for ADO.NET 1.0 when it generates code for the Local Database Cache.

Synchronization Adapter Builder

The synchronization adapter builder is modeled after the command builder in ADO.NET. You can use this tool to develop code for the synchronization commands that are executed by the server synchronization provider. The synchronization adapter builder produces SELECT, INSERT, UPDATE, and DELETE statements for SQL Server databases based on information that you provide about the tables that are involved in synchronization. The synchronization adapter builder enables you to specify the following information:

  • The tables that you want to synchronize

  • The tracking columns in those tables

  • The direction of synchronization

  • Which rows and columns to include

The synchronization adapter builder uses this information to create a synchronization adapter and Transact-SQL commands. It is compatible with SQL Server 2000 and later versions.

备注

You can use the synchronization adapter builder to become familiar with synchronization commands. However, if you can, we recommend that you manually specify commands that use stored procedures. Stored procedures can help improve the performance and security of the application.

For examples that show how to use the SqlSyncAdapterBuilder, see the following topics:

请参阅

其他资源

Offline-Only Scenarios