locked
Remote Database Syncronization RRS feed

  • Question

  • Hi,

    I am currently working on Database syncronization between a local SQLCe database and a SQL Server database. In addition I am using scopes and filters in order to filter the syncronized data.

    Following the example from http://msdn.microsoft.com/en-us/library/ff928701(v=SQL.110).aspx I finally write a simple application which sincronizes between a local SQLCe database and a local SQL Server database with Sync Framework 2.1.

    Dim clientSqlCeConn As New Data.SqlServerCe.SqlCeConnection
    clientSqlCeConn.ConnectionString = "Data Source=" + localSQLCEPath
    clientSqlCeConn.Open()
    
    Dim serverConn As New SqlConnection
    serverConn.ConnectionString = My.Settings.ServercdCatServidorConnectionString
    serverConn.Open()
    
    Dim syncOrchestrator As New Microsoft.Synchronization.SyncOrchestrator()
    syncOrchestrator.Direction = Microsoft.Synchronization.SyncDirectionOrder.Download
    
    syncOrchestrator.LocalProvider = New SqlServerCe.SqlCeSyncProvider("FilterByIdClient" + FILTER_VALUETextBox.Text, clientSqlCeConn, Nothing)
    syncOrchestrator.RemoteProvider = New SqlSyncProvider("FilterByIdClient" + FILTER_VALUETextBox.Text, serverConn, Nothing, Nothing)
    
    syncStats = syncOrchestrator.Synchronize()
    
    
    


    The code above works fine assuming that templates and filters has been created (which are). Note that both connections are defined as local databases.

    Now I would like to do the same syncronitzation but when the SQL Server database is only accesed by a WCF application service. I mean the SQL Server is not reacheable from the client, just for the WCF application service.

    Note that in the syncronitzation process the SyncOrchestrator object needs the LocalProvider (the SQLCe database) and the RemoteProvider (SQL Server database which is actually defined as local). I wonder if it

    I found this example http://msdn.microsoft.com/en-us/library/cc807255(SQL.100).aspx based on framework 1.0. Is there an easy way to do this on framework 2.1?

    Thank you

    Tuesday, October 19, 2010 6:07 PM

Answers

  • the code you cited above is using a different provider. The Local Database Cache Designer/Wizard uses the offline providers which out-of-the-box only supports SQL CE on the client (there is a sample SQL Express provider sample however). It's not really a v2.0. specific functionality but since v1.

    The changes in v2.1 is more on the collaboration/peer-to-peer providers. You can still use the Local Database Cache designer, but there is nothing new in v2.1 for the providers that it uses other than improved support for the latest SQL CE Service pack that exposes the SQL CE change tracking.

    Wednesday, October 20, 2010 5:25 PM

All replies