Sync Framework and Entity Data Model RRS feed

  • Question

  • Hi,

    I have been trying to create a basic occasionally connected application and I would like to use the Entity Data Model to access and update the data. I have successfully created an application which works when using dataset's but when I choose the EDM approach the application throws an error when trying to sync:

    Unable to enumerate changes at the DbServerSyncProvider for table 'Employers' in synchronization group 'EmployersSyncTableSyncGroup'.

    I had previously been getting this message when using datasets so following the article below

    I was able to resolve the issue by adding the utility class and referencing the  following code:

                Utility.DeleteAndRecreateCompactDatabase(Utility.ConnStr_SqlCeClientSync, true);

    Does anyone know what is required to get this working with EF?

    Any help is greatly appreciated.

    Wednesday, May 8, 2013 9:36 AM

All replies

  • am not sure how the code you posted above would solve the error. the error is on the server provider, the code above deletes and re creates the client database.

    are you trying to use EF Code First? what change tracking are you using?

    Wednesday, May 8, 2013 12:51 PM
  • No I am generating the data model from a sql database. As you say the code above basically deletes and recreates the client database when it is out of sync with the server and also outside the retention policy, which is set to 2 days by default. I am using the change tracking functionality built into sql server 2012.

    I have managed to resolve the issue now. It looks as if the connection string, in the app config, that the wizard created was wrong for the local client connection. When I recreated it from scratch it no longer threw the error.

    Bit of a strange one, as I'm not quite sure how that relates to the error being produced but as its now working I won't complain.

    Thanks anyway.

    • Edited by magamus Wednesday, May 8, 2013 1:49 PM
    Wednesday, May 8, 2013 1:48 PM