locked
Synchronization data upload not working RRS feed

  • Question

  • I am using Microsoft sync framework to upload data from client to the server . I have successfully provisioned the server and Four client databases  . Only data from one of the clients is uploading and for all other when I try to execute the ExecuteSync code , it says successfully uploaded but data is not available at the server side SQL server database. Any help on this highly appreciated

    Here is the code segment I used

    using System;
    using System.Data.SqlClient;
    using Microsoft.Synchronization;
    using Microsoft.Synchronization.Data;
    using Microsoft.Synchronization.Data.SqlServer;
    using System.Data;
    namespace ExecuteSync
    {
        class Program
        {
            private static string scopename = "";
            static void Main(string[] args)
            {
    
                SqlConnection clientConn = new SqlConnection(@"");
    
                SqlConnection serverConn = new SqlConnection(@"");
    
                SyncOrchestrator syncOrchestrator = new SyncOrchestrator();
    
    
                syncOrchestrator.LocalProvider = new SqlSyncProvider(scopename, clientConn);
    
    
                syncOrchestrator.RemoteProvider = new SqlSyncProvider(scopename, serverConn);
    
    
                syncOrchestrator.Direction = SyncDirectionOrder.Upload;
    
    
                ((SqlSyncProvider)syncOrchestrator.LocalProvider).ApplyChangeFailed += new EventHandler<DbApplyChangeFailedEventArgs>(Program_ApplyChangeFailed);
    
    
                SyncOperationStatistics syncStats = syncOrchestrator.Synchronize();
    
    
    
                Console.WriteLine("Start Time: " + syncStats.SyncStartTime);
                Console.WriteLine("Total Changes Uploaded: " + syncStats.UploadChangesTotal);
                Console.WriteLine("Uploads Failed: " + syncStats.UploadChangesFailed);
                Console.WriteLine("Total Changes Downloaded: " + syncStats.DownloadChangesTotal);
                Console.WriteLine("Complete Time: " + syncStats.SyncEndTime);
                Console.WriteLine(String.Empty);
                Console.ReadLine();
            }
    
    
    
    
            static void Program_ApplyChangeFailed(object sender, DbApplyChangeFailedEventArgs e)
            {
    
                Console.WriteLine(e.Conflict.Type);
    
                Console.WriteLine(e.Error);
            }
        }
    }


    • Edited by YuleKale Tuesday, February 13, 2018 11:03 AM
    Tuesday, February 13, 2018 11:00 AM