none
Intro to Sync Services ADO.NET RRS feed

  • Question

  • I need some clarification as to what is happening.

    I'm following: http://download.microsoft.com/download/6/7/3/6730f0e7-a649-4656-96ab-150c7501a583/IntroToSyncServicesADODetNet_HighQuality.wmv

    I would like to use wpf with entity framework instead of windows forms and datasets. I am using Sql Server 2008 Express, and Sql CE 3.5.  I have the following questions, because I cant get it to work.

    After the new sqlce database is synchronized, I'm presented with the DataSource Config Wizard.
    I choose Entity Data Model, Generate from database.
    At this point, I have the option of selecting the connection string to use to connect to the database.
    I'm assuming that the edm will connect to the client connection string (which is the sqlce database).  I then create my edm model as usual.

    My next step is to get the sync string from the .sync dialog. It gives me:

    natsdbCacheSyncAgent syncAgent = new natsdbCacheSyncAgent();
    Microsoft.Synchronization.Data.SyncStatistics syncStats = syncAgent.Synchronize();

    The video calls from merging the adapter with the cache.  I don't have an adapter with the EDM.  What I have done is just put a button on my view that calls the above code. 

    I then manually open the Sql server table (in Server Explorer) and change a value, then run my app and press the button.

    Then manually open the SqlCE table (in Server Explorer) and look at my table to see if the value is changed. 

    syncStats tells me:
    DownloadChangesApplied = 1
    TotalChangesDownloaded = 1

    so the framework knew that I changed a value it the main sql server table, but when I look at the sqlce table, nothing has changed.

    Why isn't this working?  Where are the changes applied if it isn't the sqlce database?

    Thanks for your time!

     

     

     


    Robotuner
    • Edited by Robotuner Wednesday, November 16, 2011 12:32 AM
    Wednesday, November 16, 2011 12:28 AM

Answers

  • are you sure you're looking at the right SDF file? have a look at the bin folder of your app if you have another SDF there.

    • Marked as answer by Robotuner Wednesday, November 16, 2011 4:42 PM
    Wednesday, November 16, 2011 5:59 AM
    Moderator

All replies

  • are you sure you're looking at the right SDF file? have a look at the bin folder of your app if you have another SDF there.

    • Marked as answer by Robotuner Wednesday, November 16, 2011 4:42 PM
    Wednesday, November 16, 2011 5:59 AM
    Moderator
  • ha, ha!!  I was trying to simplify my testing of the sync framework and lost sight of the what I was checking.  Your'e right, I was looking at the wrong file.
    Robotuner
    Wednesday, November 16, 2011 4:41 PM