locked
Help troubleshooting WCF Sync Service with SQLCE RRS feed

  • Question

  • I have written a small mobile app and used the Walkthrough to create a wcf sync service to the northwind db.  When I run my service the
                                IPAQWebReference.IPAQCacheSyncService webSvcProxy = new IPAQQuestionnaire.IPAQWebReference.IPAQCacheSyncService();
                                Microsoft.Synchronization.Data.ServerSyncProviderProxy serverProvider = new Microsoft.Synchronization.Data.ServerSyncProviderProxy(webSvcProxy);
    
                                IPAQCacheSyncAgent syncAgent = new IPAQCacheSyncAgent();
                                syncAgent.RemoteProvider = serverProvider;
                                syncAgent.ipaq_tblQuestionnaires.SyncDirection = Microsoft.Synchronization.Data.SyncDirection.Bidirectional;
    
                                Microsoft.Synchronization.Data.SyncStatistics stats = syncAgent.Synchronize();
                                MessageBox.Show("Changes Downloaded: " + stats.TotalChangesDownloaded.ToString() + "\r\n" + "Changes Uploaded: " + stats.TotalChangesUploaded.ToString());
                                

    I can step through the code without errors. My Messagebox tells me Downloaded 1 which is correct but the db in my device project never gets updated. Still shows the same 2 records that were originally in my master table when I setup the sync service.


    Any Idea how to troubleshoot this or suggestions on making it work?
    thanks
    Bill
    • Moved by Hengzhe Li Friday, April 22, 2011 2:27 AM (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Friday, July 10, 2009 7:03 PM

Answers

  • The issue was that when you are using the emulator and syncing data, one needs to check the db on the emulator not within the project. Here you should see the data was synced.

    The db within your project is the default db that gets loaded into the emulator (It gets created during the creation of the sync service) . Once you run sync the data is updated only on the emulator. If you want to update the db within your project, remove the tables from within the Client.sync and re-add them. This will refresh the db with the current data from your Server db.
    • Marked as answer by bspack Friday, July 24, 2009 4:06 PM
    Friday, July 24, 2009 4:05 PM

All replies

  • Hi Bill,
       From the descroption, It appears that something might be failing during change application process.You could  turn on tracing to get some debug info to see what is happening.  For how to enable tracing, see:
    http://msdn.microsoft.com/en-us/library/cc807160.aspx

    Or you can hook up into the ApplyChangeFailedEvent,  and observe the ApplyChangeFailedEventArgs object show for its SyncConflict and Error properties.

    thanks
    Jandeep


    jandeepc
    Monday, July 13, 2009 6:33 AM
  • hi,

    r u developing application for mobile & using SQL compact server...

    in that case when u open the database in between the application is running ,the database get corrupted or shows wrong data....

    close the application & then open the DB ..the data should be there...
    Friday, July 17, 2009 11:16 AM
  • The issue was that when you are using the emulator and syncing data, one needs to check the db on the emulator not within the project. Here you should see the data was synced.

    The db within your project is the default db that gets loaded into the emulator (It gets created during the creation of the sync service) . Once you run sync the data is updated only on the emulator. If you want to update the db within your project, remove the tables from within the Client.sync and re-add them. This will refresh the db with the current data from your Server db.
    • Marked as answer by bspack Friday, July 24, 2009 4:06 PM
    Friday, July 24, 2009 4:05 PM