none
Error when syncing sql server and sqlserver express RRS feed

  • Question

  • I am getting the following error in the middle of trying to provisions my databases:

    ERROR: The current operation could not be completed because the database is not
    provisioned for sync or you not have permissions to the sync configuration table
    s.


    Server stack trace:
       at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message
     reply, MessageFault fault, String action, MessageVersion version, FaultConverte
    r faultConverter)
       at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRunt
    ime operation, ProxyRpc& rpc)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean on
    eway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan tim
    eout)
       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCall
    Message methodCall, ProxyOperationRuntime operation)
       at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

    Exception rethrown at [0]:
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage req
    Msg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgDa
    ta, Int32 type)
       at DebugClient.SqlSyncWebService.IClientSyncServiceContract.StartSync()
       at DebugClient.SqlSyncWebService.ClientSyncServiceContractClient.StartSync()

     

     

    The insteresting thing is it creates almost everything it needs, triggers etc., in both databases and then just dies with that error. Anyone have any ideas? I am using version 2.1 of the framework. Thank you for your help.

     

     

    Monday, October 18, 2010 8:32 PM

Answers

  • After extensive debugging I decided to put a stop on all my "new SqlSynProvider()" calls and found that one out of the bunch was failing to call the schema, actually it was overwriting my original instantiation with blank schema settings. I am going to eliminate the duplicates and clean it all up. I appreciate your help and time. I am just glad I got this fixed. I have learned a lot from this and would have never found it without the sql trace that was suggested etc, which made me learn some new things about debugging. Thanks again.
    • Marked as answer by KryptonianSon Friday, October 22, 2010 12:57 PM
    Friday, October 22, 2010 12:56 PM

All replies

  • Going back through the database after the error occurs, I cannot see a single thing that would be missing. All the proper tracking triggers/tables/procedures appear to be all there. Not sure what to think. Is there some kind of permission issue that could happen even though I am able to completely create all the needed data and I only die at the actual sync? But if I run it again it tells me the scope exists and errors out again. Very strange.
    Monday, October 18, 2010 8:40 PM
  • One more thing, if I use the same database(s) on my local machine and sync everything between two databases in sql express it works just fine. It is failing when connecting my local sql express (which I first create a blank database for) and then sync from the remote sql server (not express) that resides on another machine. Hope this additional information helps.
    Monday, October 18, 2010 8:46 PM
  • have you tried running SQL Profiler to see the actual SQL statement failing or enable Sync Fx tracing to see where it actually fails?
    Tuesday, October 19, 2010 2:45 AM
    Moderator
  • JuneT,

    Here are the ending results in my trace, all the creation of all the tables and triggers etc are fine.

    INFO   , Magazine.Bridge.Host, 7, 10/20/2010 13:25:27:558, --- END Provisioning Table '[MagazineLanguage]' ---
    INFO   , Magazine.Bridge.Host, 7, 10/20/2010 13:25:27:558, Updating Scope Config Status of Scope '92ab9d98-4bdf-42bc-864b-3818271b1712' to 'C'
    VERBOSE, Magazine.Bridge.Host, 7, 10/20/2010 13:25:27:558,    Executing Command: UPDATE [scope_config] SET scope_status = 'C'
    WHERE [config_id] = '92ab9d98-4bdf-42bc-864b-3818271b1712';
    INFO   , Magazine.Bridge.Host, 7, 10/20/2010 13:25:27:558, --- END Provisioning Scope 'languageservice_tables' on Database 'LanguageService' ---
    INFO   , Magazine.Bridge.Host, 12, 10/20/2010 13:25:27:636,    BeginSession() called on Provider SqlSyncProvider, Microsoft.Synchronization.Data.SqlServer, Version=3.1.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91
    VERBOSE, Magazine.Bridge.Host, 12, 10/20/2010 13:25:27:636, Connecting using string: Data Source=sqllab;Initial Catalog=LanguageService;Integrated Security=True;Connect Timeout=1
    ERROR  , Magazine.Bridge.Host, 12, 10/20/2010 13:25:27:652, The current operation could not be completed because the database is not provisioned for sync or you not have permissions to the sync configuration tables. Exception: Microsoft.Synchronization.Data.DbNotProvisionedException: The current operation could not be completed because the database is not provisioned for sync or you not have permissions to the sync configuration tables.
       at Microsoft.Synchronization.Data.SqlServer.SqlManagementUtils.VerifyRuntimeVersionExceedsSchema(SqlConnection connection, String objectPrefix, String objectSchema, Boolean throwWhenNotProvisioned)

     

    I would also like to add that I have also tested this from sql server to sql server (not using express) and it is still happening so I know it is not a versioning issue. Also I have given myself db owner priv. so I doubt permissions are the problem, but then I don't know what to think at this point.

    Wednesday, October 20, 2010 1:33 PM
  • do you see a table schema.info? does it contain anything?
    Wednesday, October 20, 2010 3:16 PM
    Moderator
  • Yes it contains major = 2; minor = 1; extension = blank;

    It is just as you would expect.

    I did try adding myself as sysadmin to see if that had any affect and everything worked just fine, completed normally. So I did a sql trace/profile to see what function it is failing on. This the sql code where I am getting an exception error:

    exec sp_executesql N'SELECT [c].[config_data], [c].[config_id], [s].[scope_user_comment] FROM [scope_info] [s] JOIN [scope_config] [c] ON [s].[scope_config_id] = [c].[config_id] WHERE [sync_scope_name] = @scopeName',N'@scopeName nvarchar(22)',@scopeName=N'languageservice_tables'

    Error: 208, Severity: 16, State: 1

    There is clearly some permissions issue that is resolved with sysadmin priv. but not with dbowner. Any further ideas? Is there a document that tells me the exact required permissions for SqlSyncProvider? Thank you for everything.

    • Edited by KryptonianSon Wednesday, October 20, 2010 3:50 PM typo
    Wednesday, October 20, 2010 3:41 PM
  • I found this document:

    http://msdn.microsoft.com/en-us/library/bb726013(v=SQL.110).aspx

    So I am going to verify permissions and see what is missing, if anything.

    Wednesday, October 20, 2010 4:01 PM
  • I have tried giving my schema all the documented permissions and it does not work. I am at a loss. What should I do next?

    Wednesday, October 20, 2010 6:24 PM
  • Ok, so if I use dbo as the schema it works fine, but if I use some other name for a schema i create, it no longer works. What am I doing wrong here?
    Wednesday, October 20, 2010 8:43 PM
  • are you specifying the schema via the ObjectSchema property when provisioning?
    Thursday, October 21, 2010 12:31 AM
    Moderator
  • Yes I am. Do you (or anyone else) have some instructions I can look at to ensure that I am setting up the schema properly? May as well double check if I am missing something or not.
    Thursday, October 21, 2010 11:54 AM
  • I have to be getting close because if I call out the dbo schema specifically then it works just fine, if I call out my created schema, then it fails even though it creates everything. So it seems that the schema has a permission problem. Anyone have a sql script to create a working schema with the correct permissions?
    Thursday, October 21, 2010 12:32 PM
  • This is the script I made and am currently using. Am I missing something? (of course I am, but what?)

     

    CREATE

     

    ROLE [Developer_Role] AUTHORIZATION [dbo]

    GO

    GRANT

     

    EXECUTE ON SCHEMA::[SyncSchema] TO [Developer_Role]

    GO

    GRANT

     

    SELECT ON SCHEMA::[SyncSchema] TO [Developer_Role]

    GO

    GRANT

     

    INSERT ON SCHEMA::[SyncSchema] TO [Developer_Role]

    GO

    GRANT

     

    UPDATE ON SCHEMA::[SyncSchema] TO [Developer_Role]

    GO

    GRANT

     

    DELETE ON SCHEMA::[SyncSchema] TO [Developer_Role]

    GO

    GRANT

     

    ALTER ON SCHEMA::[SyncSchema] TO [Developer_Role]

    GO

    GRANT

     

    REFERENCES ON SCHEMA::[SyncSchema] TO [Developer_Role]

    GO

    GRANT

     

    DELETE ON SCHEMA::[dbo] TO [Developer_Role]

    GO

    GRANT

     

    INSERT ON SCHEMA::[dbo] TO [Developer_Role]

    GO

    GRANT

     

    SELECT ON SCHEMA::[dbo] TO [Developer_Role]

    GO

    GRANT

     

    UPDATE ON SCHEMA::[dbo] TO [Developer_Role]

    Thursday, October 21, 2010 12:41 PM
  • during provisioning, can you try setting the ObjectSchema property after you have added all the tables to the scope and before calling Apply?
    Thursday, October 21, 2010 3:15 PM
    Moderator
  • I have tried what you suggest and it has the exact same affect. I am setting the schema right before Apply.
    Thursday, October 21, 2010 3:31 PM
  • how about doing an ALTER USER to set the default schema to your schema other than dbo?

    Thursday, October 21, 2010 4:05 PM
    Moderator
  • It has the exact same effect. Again, if I use the dbo schema, and specifiy it, it works just fine. If I set another one as default and specify it, then it does not work.
    Thursday, October 21, 2010 5:03 PM
  • After extensive debugging I decided to put a stop on all my "new SqlSynProvider()" calls and found that one out of the bunch was failing to call the schema, actually it was overwriting my original instantiation with blank schema settings. I am going to eliminate the duplicates and clean it all up. I appreciate your help and time. I am just glad I got this fixed. I have learned a lot from this and would have never found it without the sql trace that was suggested etc, which made me learn some new things about debugging. Thanks again.
    • Marked as answer by KryptonianSon Friday, October 22, 2010 12:57 PM
    Friday, October 22, 2010 12:56 PM
  • I have been getting the same error message but with a different Debug Stack.

     

    / After the filtered scope has been defined and the client database is provisioned, the client can be synchronized by creating SqlSyncProvider objects
               // for the filtered scope in the client and server databases, associating the providers with a SyncOrchestrator object, and by calling the Synchronize method.

               // create the sync orhcestrator
                var syncOrchestrator = new SyncOrchestrator();

                // set local provider of orchestrator to a CE sync provider associated with the 
                // FilteredCandidates in the SyncCompactDB compact client database
                syncOrchestrator.LocalProvider = new SqlCeSyncProvider("FilteredCandidates",_clientConn);
                
                // set the remote provider of orchestrator to a server sync provider associated with
                // the FilteredCandidates in the SyncDB server database
                syncOrchestrator.RemoteProvider = new SqlSyncProvider("FilteredCandidates", _serverConn);

                // set the direction of sync session to Upload and Download
               // syncOrchestrator.Direction = SyncDirectionOrder.UploadAndDownload;

                // execute the synchronization process
                SyncOperationStatistics syncStats = syncOrchestrator.Synchronize();
    Microsoft.Synchronization.Data.DbNotProvisionedException was unhandled
      Message=The current operation could not be completed because the database is not provisioned for sync or you not have permissions to the sync configuration tables.
      Source=Microsoft.Synchronization
      StackTrace:
           at Microsoft.Synchronization.Data.SqlServerCe.SqlCeManagementUtils.VerifyRuntimeAndSchemaVersionsMatch(SqlCeConnection connection, SqlCeTransaction trans, String objectPrefix, Boolean autoUpgrade, Boolean throwWhenNotProvisioned)
           at Microsoft.Synchronization.Data.SqlServerCe.SqlCeSyncProvider.Connect()
           at Microsoft.Synchronization.Data.SqlServerCe.SqlCeSyncProvider.InitializeAdapters()
           at Microsoft.Synchronization.Data.SqlServerCe.SqlCeSyncProvider.BeginSession(SyncProviderPosition position, SyncSessionContext syncSessionContext)
           at Microsoft.Synchronization.KnowledgeProviderProxy.BeginSession(SYNC_PROVIDER_ROLE providerRole, ISyncSessionState pSessionState)
           at Microsoft.Synchronization.CoreInterop.ISyncSession.Start(CONFLICT_RESOLUTION_POLICY resolutionPolicy, _SYNC_SESSION_STATISTICS& pSyncSessionStatistics)
           at Microsoft.Synchronization.KnowledgeSyncOrchestrator.DoOneWaySyncHelper(SyncIdFormatGroup sourceIdFormats, SyncIdFormatGroup destinationIdFormats, KnowledgeSyncProviderConfiguration destinationConfiguration, SyncCallbacks DestinationCallbacks, ISyncProvider sourceProxy, ISyncProvider destinationProxy, ChangeDataAdapter callbackChangeDataAdapter, SyncDataConverter conflictDataConverter, Int32& changesApplied, Int32& changesFailed)
           at Microsoft.Synchronization.KnowledgeSyncOrchestrator.DoOneWayKnowledgeSync(SyncDataConverter sourceConverter, SyncDataConverter destinationConverter, SyncProvider sourceProvider, SyncProvider destinationProvider, Int32& changesApplied, Int32& changesFailed)
           at Microsoft.Synchronization.KnowledgeSyncOrchestrator.Synchronize()
           at Microsoft.Synchronization.SyncOrchestrator.Synchronize()
           at SyncWinForm.SyncMain.btnSyncRequestTable_Click(Object sender, EventArgs e) in R:\VisualStudio2010\SyncWinForm\SyncWinForm\SyncMain.cs:line 172
           at System.Windows.Forms.Control.OnClick(EventArgs e)
           at System.Windows.Forms.Button.OnClick(EventArgs e)
           at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
           at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
           at System.Windows.Forms.Control.WndProc(Message& m)
           at System.Windows.Forms.ButtonBase.WndProc(Message& m)
           at System.Windows.Forms.Button.WndProc(Message& m)
           at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
           at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
           at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
           at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
           at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
           at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
           at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
           at System.Windows.Forms.Application.Run(Form mainForm)
           at SyncWinForm.Program.Main() in R:\VisualStudio2010\SyncWinForm\SyncWinForm\Program.cs:line 18
           at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
           at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
           at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
           at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
           at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
           at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
           at System.Threading.ThreadHelper.ThreadStart()
      InnerException:
    // Step 1 for Parameter-based Filter
                // Create a scope named "filtered_candidate_template", and add two tables to the scope.
                // GetDescriptionForTable gets the schema of each table, so that tracking 
                // tables and triggers can be created for that table.
                var scopeDesc = new DbSyncScopeDescription("filtered_candidate_template");

                // Set a description of the template.
                scopeDesc.UserComment = "Template for Candidate and CandidateForm tables. Candidate data is filtered by DeviceID parameter.";

                //// Definition for tables.
                DbSyncTableDescription candidateDescription = SqlSyncDescriptionBuilder.GetDescriptionForTable("Candidate", _serverConn);
                scopeDesc.Tables.Add(candidateDescription);
                DbSyncTableDescription candidateFormDescription = SqlSyncDescriptionBuilder.GetDescriptionForTable("CandidateForm", _serverConn);
                scopeDesc.Tables.Add(candidateFormDescription);

                // Create a provisioning object for "filtered_candidate_template" that can be used to create a template
                // from which filtered synchronization scopes can be created. We specify that
                // all synchronization-related objects should be created in a 
                // database schema named "Sync". If you specify a schema, it must already exist in the database.
                var serverTemplate = new SqlSyncScopeProvisioning(_serverConn, scopeDesc, SqlSyncScopeProvisioningType.Template);
                serverTemplate.ObjectSchema = "Sync";

                // Specify the column in the Candidate table to use for filtering data, 
                // and the filtering clause to use against the tracking table.
                // "[side]" is an alias for the tracking table.
                // The DeviceID column that defines the filter is set up as a parameter in this template.
                // An actual customer type will be specified when the synchronization scope is created.
                serverTemplate.Tables["Candidate"].AddFilterColumn("DeviceID");
                serverTemplate.Tables["Candidate"].FilterClause = "[side].[DeviceID] = @deviceID";
                var param = new SqlParameter("@deviceID"SqlDbType.UniqueIdentifier);
                serverTemplate.Tables["Candidate"].FilterParameters.Add(param);

                // Create the "filtered_candidate_template" template in the database.
                // This action creates tables and stored procedures in the database, so appropriate database permissions are needed.
                //TextWriter tw = new StreamWriter("Forms.txt");
                //tw.WriteLine(serverTemplate.Script());
                //tw.Close();

                //string theSQL = serverTemplate.Script();
                serverTemplate.Apply();
      // Step 2 Now provision the SQL Server Compact database with the new filtered scope.
                DbSyncScopeDescription clientSqlCeDesc = SqlSyncDescriptionBuilder.GetDescriptionForScope("FilteredCandidates"null"Sync", _serverConn);
                var clientSqlCeConfig = new SqlCeSyncScopeProvisioning(_clientConn, clientSqlCeDesc);
                clientSqlCeConfig.ObjectPrefix = "Sync";
                clientSqlCeConfig.SetCreateTableDefault(DbSyncCreationOption.Create);
                clientSqlCeConfig.Apply();
    I'm using the 2.1 Stack Any Thoughts?
    Monday, November 1, 2010 4:07 PM
  • I see you are setting the ObjectSchema when provisioning, but in your code snippets I do not see you also telling your local and remote providers what the ObjectSchema is. Be sure you are telling everyone about it. All your providers etc.
    Monday, November 1, 2010 6:25 PM
  •  // create the sync orhcestrator
                var syncOrchestrator = new SyncOrchestrator();

                // set local provider of orchestrator to a CE sync provider associated with the 
                // FilteredCandidates in the SyncCompactDB compact client database
                syncOrchestrator.LocalProvider = new SqlCeSyncProvider("FilteredCandidates",_clientConn,"Sync");
                
                // set the remote provider of orchestrator to a server sync provider associated with
                // the FilteredCandidates in the SyncDB server database
                syncOrchestrator.RemoteProvider = new SqlSyncProvider("FilteredCandidates", _serverConn,"Sync");

                // set the direction of sync session to Upload and Download
                syncOrchestrator.Direction = SyncDirectionOrder.UploadAndDownload;

                // execute the synchronization process
                SyncOperationStatistics syncStats = syncOrchestrator.Synchronize();

    Like so? I did try that at one point. no luck, looks like I do get a different Execption Though.

    Microsoft.Synchronization.Data.DbNotProvisionedException was unhandled
      Message=The current operation could not be completed because the database is not provisioned for sync or you not have permissions to the sync configuration tables.
      Source=Microsoft.Synchronization
      StackTrace:
           at Microsoft.Synchronization.Data.SqlServer.SqlManagementUtils.VerifyRuntimeVersionExceedsSchema(SqlConnection connection, String objectPrefix, String objectSchema, Boolean throwWhenNotProvisioned)
           at Microsoft.Synchronization.Data.SqlServer.SqlSyncProvider.Configure()
           at Microsoft.Synchronization.Data.SqlServer.SqlSyncProvider.BeginSession(SyncProviderPosition position, SyncSessionContext syncSessionContext)
           at Microsoft.Synchronization.KnowledgeProviderProxy.BeginSession(SYNC_PROVIDER_ROLE providerRole, ISyncSessionState pSessionState)
           at Microsoft.Synchronization.CoreInterop.ISyncSession.Start(CONFLICT_RESOLUTION_POLICY resolutionPolicy, _SYNC_SESSION_STATISTICS& pSyncSessionStatistics)
           at Microsoft.Synchronization.KnowledgeSyncOrchestrator.DoOneWaySyncHelper(SyncIdFormatGroup sourceIdFormats, SyncIdFormatGroup destinationIdFormats, KnowledgeSyncProviderConfiguration destinationConfiguration, SyncCallbacks DestinationCallbacks, ISyncProvider sourceProxy, ISyncProvider destinationProxy, ChangeDataAdapter callbackChangeDataAdapter, SyncDataConverter conflictDataConverter, Int32& changesApplied, Int32& changesFailed)
           at Microsoft.Synchronization.KnowledgeSyncOrchestrator.DoOneWayKnowledgeSync(SyncDataConverter sourceConverter, SyncDataConverter destinationConverter, SyncProvider sourceProvider, SyncProvider destinationProvider, Int32& changesApplied, Int32& changesFailed)
           at Microsoft.Synchronization.KnowledgeSyncOrchestrator.Synchronize()
           at Microsoft.Synchronization.SyncOrchestrator.Synchronize()
           at SyncWinForm.SyncMain.btnSyncRequestTable_Click(Object sender, EventArgs e) in R:\VisualStudio2010\SyncWinForm\SyncWinForm\SyncMain.cs:line 172
           at System.Windows.Forms.Control.OnClick(EventArgs e)
           at System.Windows.Forms.Button.OnClick(EventArgs e)
           at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
           at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
           at System.Windows.Forms.Control.WndProc(Message& m)
           at System.Windows.Forms.ButtonBase.WndProc(Message& m)
           at System.Windows.Forms.Button.WndProc(Message& m)
           at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
           at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
           at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
           at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
           at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
           at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
           at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
           at System.Windows.Forms.Application.Run(Form mainForm)
           at SyncWinForm.Program.Main() in R:\VisualStudio2010\SyncWinForm\SyncWinForm\Program.cs:line 18
           at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
           at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
           at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
           at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
           at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
           at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
           at System.Threading.ThreadHelper.ThreadStart()
      InnerException:

    Monday, November 1, 2010 6:48 PM
  • Very close, you have part of it, what you set there was the ObjectPrefix which you are indeed setting, you also need to set the ObjectSchema. Should be more like this:

    // create the sync orhcestrator
                var syncOrchestrator = new SyncOrchestrator();

                // set local provider of orchestrator to a CE sync provider associated with the 
                // FilteredCandidates in the SyncCompactDB compact client database
                syncOrchestrator.LocalProvider = new SqlCeSyncProvider("FilteredCandidates",_clientConn,"Sync","Sync");
                
                // set the remote provider of orchestrator to a server sync provider associated with
                // the FilteredCandidates in the SyncDB server database
                syncOrchestrator.RemoteProvider = new SqlSyncProvider("FilteredCandidates", _serverConn,"Sync","Sync");

                // set the direction of sync session to Upload and Download
                syncOrchestrator.Direction = SyncDirectionOrder.UploadAndDownload;

                // execute the synchronization process
                SyncOperationStatistics syncStats = syncOrchestrator.Synchronize();

    In step one of your code, you are calling ObjectSchema, in step two you are calling ObjectPrefix. You need to be sure you are setting both of them (if that is indeed what you meant to do) in all places. I hope this helps.

    Monday, November 1, 2010 8:35 PM