In my last post I left you hanging to see what would happen when I created a new .sync item from the Add New Item dialog. So here you go, the following is what the synchronisation configuration screen looks like in the March CTP – bearing in mind it is likely to change, so if you don’t like it say so at http://connect.microsoft.com.
For anyone familiar with the MS Sync Services you will immediately see that under Database Connections you can define both a server and a client connection. This uses the same set of connection strings that are defined within you app.config file for you application. You can either use an existing connection or create one using the New button.
Under Synchronisation we have the option of specifying how frequently a synchronisation is attempted. There are a whole bunch of different rules that could be used to define when a synchronisation should be executed so I suspect that this is too simplistic for most developers. The last option here is the “Synchronize tables in a single transaction” – this can be particularly important where you have relationships between tables (for example orders and order details) and you want to make sure you either get everything or nothing (ie all my order information, or none at all).
Clicking the Advanced + button expands out the dialog to include the following settings:
One of the nice features of the MS Sync Services is its ability to be split so that the client and server logic doesn’t all run locally to the application. This might be across webservices, wcf or the macaroni protocol (basically it doesn’t matter how the data gets there so long as it does). The advanced settings allows us to configure how the designer generates code. For example you could elect to only generate client, only server or both client and server code. You might want to split the code across two projects (for example the client code might be in the application assembly, which the server code might be in a supporting webservice project).
Going back out to the main dialog we can see that there is an Add Item button. This opens the following dialog which allows us to specify which tables from the server we want to synchronise to the client.
As you can see there is only one table in my database, called Attachments. The designer uses the Sync Builder to generate the Sync adapters it needs. As such this dialog is really configuring the Sync Builder so that it can in turn generate the appropriate Sync Adapters. For more information on how the build works, and as such how these parameters work head across to the MSDN Forum or to www.sqlserverce.org and subscribe to the Sync Services FAQ.