none
Sync Framework Reference Issue RRS feed

  • Question

  • I am trying to setup database synchronization from a Windows Mobile 5.0 SQL Compact Edition database to a SQL 2008 Standard Edition database.  I am using .NET Compact Framework 3.5.

     

    I have the following references to my project:

    • Microsoft.Synchronization (Version 2.0.0.0; Path C:\Program Files (x86)\Microsoft Sync Framework\2.0\Runtime\x86\Microsoft.Synchronization.dll)
    • Microsoft.Synchronization.Data (Version 3.0.0.0; Path C:\Program Files (x86)\Microsoft Sync Framework\2.0\Runtime\ADO.NET\V3.0\x86\Microsoft.Synchronization.Data.dll)
    • Microsoft.Synchronization.Data.Server (Version 3.0.0.0; Path C:\Program Files (x86)\Microsoft Sync Framework\2.0\Runtime\ADO.NET\V3.0\x86\Microsoft.Synchronization.Data.Server.dll)
    • Microsoft.Synchronization.Data.SqlServer (Version 3.0.0.0; Path C:\Program Files (x86)\Microsoft Sync Framework\2.0\Runtime\ADO.NET\V3.0\x86\Microsoft.Synchronization.Data.SqlServer.dll)
    • Microsoft.Synchronization.Data.SqlServerCe (Version 3.0.0.0; Path C:\Program Files (x86)\Microsoft Sync Framework\2.0\Runtime\ADO.NET\V3.0\x86\Microsoft.Synchronization.Data.SqlServerCe.dll)
    • System (Version 3.5.0.0; Path C:\Program Files (x86)\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE\System.dll)
    • System.Core (Version 3.5.0.0; Path C:\Program Files (x86)\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE\System.Core.dll)
    • System.Data (Version 3.5.0.0; Path C:\Program Files (x86)\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE\System.Data.dll)
    • System.Data.DataSetExtensions (Version 3.5.0.0; Path C:\Program Files (x86)\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE\System.Data.DataSetExtensions.dll)
    • System.Data.SqlClient (Version 3.0.3600.0 Path C:\Program Files (x86)\Microsoft Visual Studio 8\SmartDevices\SDK\SQL Server\Client\v2.0\System.Data.SqlClient.dll)
    • System.Xml (Version 3.5.0.0 Path C:\Program Files (x86)\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE\System.Xml.dll)
    • System.Xml.Linq (Version 3.5.0.0 Path C:\Program Files (x86)\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE\System.Xml.Linq.dll)

     

    Here is a code snippet that is causing a problem:

    Imports System.Data
    Imports System.Data.SqlClient
    Imports Microsoft.Synchronization.Data.SqlServerCe
    Imports Microsoft.Synchronization.Data.Server
    Imports Microsoft.Synchronization.Data.SqlServer

    Public Class clsSync
        Public Function DoSync() As Boolean
            Dim util As clsUtility
            Dim serverConn As SqlConnection
            Dim clientConn As SqlConnection
            Dim orcTemp As clsOrchestrator
            Dim prvClient As SqlCeClientSyncProvider
            Dim prvServer As SqlSyncProvider

            Try
                util = New clsUtility()
                serverConn = New SqlConnection(clsUtility.ConnStr_SqlSync_Server)
                prvClient = New SqlCeClientSyncProvider(clsUtility.ConnStr_SqlSync_Client)
                prvServer = New SqlSyncProvider()


                Return True
            Catch ex As Exception
                Return False
            End Try
        End Function
    End Class

    The bold line with prvServer = New SqlSyncProvider() gives the following error: "Reference required to assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' containing the type 'System.Data.SqlClient.SqlConnection'. Add one to your project."

    I'm guessing that something is incorrect about my references.  I see that the error tells me I need 2.0 versus the 3.5 that I have in the project.  I've tried that version under this project and I have tried creating a 2.0 project that had that version and it gives a different error, so I have to conclude that the problem lies elsewhere.

    Any ideas?

    Thanks,

    Bob Crawford

    Monday, April 19, 2010 8:53 PM

Answers

  • Are you using a device project?

    The collaboration providers (SQLSyncProvider/SQLCESyncProvider) are not supported on devices. The Synchronization Services for ADO.NET (Devices) (SQLCEClientSyncProvider offline provider) which comes with V1 is the one supported on devices.

    If you are creating a Device project, you may follow this instead: http://msdn.microsoft.com/en-us/library/cc488004(VS.90).aspx

    If it's not a device project, remove this reference C:\Program Files (x86)\Microsoft Visual Studio 8\SmartDevices\SDK\SQL Server\Client\v2.0\System.Data.SqlClient.dll)  and replace with the non-Compact Framework version of System.Data.SQLClient.

    Monday, April 19, 2010 11:15 PM
    Moderator

All replies

  • Are you using a device project?

    The collaboration providers (SQLSyncProvider/SQLCESyncProvider) are not supported on devices. The Synchronization Services for ADO.NET (Devices) (SQLCEClientSyncProvider offline provider) which comes with V1 is the one supported on devices.

    If you are creating a Device project, you may follow this instead: http://msdn.microsoft.com/en-us/library/cc488004(VS.90).aspx

    If it's not a device project, remove this reference C:\Program Files (x86)\Microsoft Visual Studio 8\SmartDevices\SDK\SQL Server\Client\v2.0\System.Data.SqlClient.dll)  and replace with the non-Compact Framework version of System.Data.SQLClient.

    Monday, April 19, 2010 11:15 PM
    Moderator
  • Thanks for your advice on this subject.  I am indeed using a device project.
    Tuesday, April 20, 2010 4:32 PM