Microsoft Synchronization Services RRS feed

  • Question

  • I  am trying to synchronize a SQL Compact 3.5 SP1  Mobile database with a Sql Server 2005 database using Microsoft Synchronisation Server.

     I have created a class which inherits from DbServerSyncProvider as it shows in the samples.  I create a SqlConnection object and assign it to the Connection property, but it will not compile.  Here is the class:



    public class SampleServerSyncProvider : DbServerSyncProvider












    serverConn = new SqlConnection(util.ServerConnString);


    this.Connection = serverConn;







    When I try to compile, I get these errors:


    Error 1 The type 'System.Data.IDbConnection' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089'. 

    Error 2 Cannot implicitly convert type 'System.Data.SqlClient.SqlConnection' to 'System.Data.IDbConnection' 

    How to resolve the assembly version conflicts? I tried by adding System.Data from .NET Framewrok 2.0 but still not resolved.


    Can anyone tell me what I'm doing wrong here?





    • Moved by Hengzhe Li Friday, April 22, 2011 2:57 AM (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Friday, June 19, 2009 4:36 PM


  • Hi,

    From your compile errors, I think you need to correct two things in your project:

    1. Please ensure that the System.Data.dll with version= is added to your project reference list.
    2. The type of DbServerSyncProvider.Connection is IDbConnection. SqlConnection implements this interface. You may want to try: this.Connection = (IDbConnection)serverConn.


    This posting is provided AS IS with no warranties, and confers no rights.
    Friday, June 19, 2009 4:59 PM