Microsoft sync framework wcf example




















When synchronizing databases, you may retrieve synchronization operation statistics. It includes the time synchronization took, the number of processed changes and failed changes. In case there is no need to synchronise a database or any specific scope any more, the database or scope can be deprovisioned. User tables and data are retained. Other synchronization classes of dotConnect for DB2 are not inherited from the standard Sync Framework classes, but provide the same interface.

In our tutorial we will synchronize two databases with identical structure. Let's call them the development database and the production database. We will use a simple database of one table "Product" for our tutorial. Here is its script:. If you want to configure data synchronization for a new database, and its tables are not created yet, they can be automatically generated during the provisioning.

However, in our tutorial we will create them manually. Create a new console application in Visual Studio. It could be any other project type as well, but for simplicity's sake we'll use console project throughout the tutorial. The first step of the synchronization is database provisioning.

We will start from the development database and demonstrate different provisioning scenarios. Provisioning includes defining the synchronization scope and creating the necessary database objects.

The synchronization scope is one or more tables with the specified columns to synchronize that will be synchronized as a whole. The synchronization scope can include all columns in a table or just a subset of them. It can include all rows or only the rows that match some filter condition.

You also can create a template for filters a condition including a variable , and then create multiple synchronization scopes using filters based on this template. When creating a synchronization scope, you must create descriptions for the tables of this scope. The synchronization scope tables can either already exist in the database, or they be created during the database provisioning based on their descriptions. You can create table descriptions in two ways. The first way is to create the description manually, and the second is to use the DB2SyncDescriptionBuilder class to generate the description based on an existing database table.

Since the tables are already created, we will use the second option. After executing this code, Sync Framework creates the following database objects in the database:. Now we will demonstrate creating synchronization scope with a filter. This filter condition is added to the selectchanges procedure that gets the changed data.

The AddFilterColumn call specifies the column from the provisioned table, that will be used in the filter and must be added to the tracking table. FilterClause specifies the condition. Note that we use the alias t when specifying the condition. This alias refers to the tracking table. Sync Framework also creates the stored procedure for selecting changes with the specified filter applied. Creating a filter template is similar to creating a synchronization scope with a filter.

Notify me of new comments via email. Notify me of new posts via email. JuneT's idle thoughts. About me Contact. Code Snippet. GetChanges groupMetadata, syncSession ;. DataSet syncContext. Changes syncContext. CompactFormatterPlus ; cf. Serialize memStream, syncContext.

ApplyChanges groupMetadata, memStream. GetSchema tableNames. Synchronize ;. Like this: Like Loading Hi June, I am running SyncFx 1. Thanks so much, Shane. Will this work for compact framework based windows mobile sync application? Leave a Reply Cancel reply Enter your comment here Fill in your details below or click an icon to log in:. Email required Address never made public.

Name required. Twitter Updates RT amandaksilver : Working in tech is more than just knowing how to code. Confidence, emotional intelligence, self-efficacy - are as founda… 3 months ago RT thejuicemedia : Today Australia officially went into recession for the first time since , so I thought it would be good to revisit o… 1 year ago Follow jtabadero.

Categories ASP. Blog at WordPress. Follow Following. JuneT's idle thoughts Join other followers. Details Note: There are multiple files available for this download. Once you click on the "Download" button, you will be prompted to select the files you need. File Name:. Date Published:. File Size:. System Requirements Supported Operating System. Install Instructions Important: Please uninstall all prerelease versions of Sync Framework prior to installing this release version.

This includes Sync Framework 2. Sync Framework 2. Please ensure that you download and install the SDK appropriate for your system. For example, SyncSDK-v2. It is not possible have full bit Sync Framework 2.

See Sync Framework Tips and Troubleshooting topic for details. Make sure you have the latest service pack and critical updates for the version of Windows that you are running. To find recent security updates, visit Windows Update. Related Resources Microsoft Sync Framework 2. Follow Microsoft Facebook Twitter.



0コメント

  • 1000 / 1000