locked
sync services and foreign key RRS feed

  • Question

  • Hello,
    I am currently developing a mobile application with. Net Compact Framework 3.5 which sync with Sync Services via WCF.

    I have two tables Customer and Event linked by a foreign key so that each customer creation adds a new line in Event.

    Problem is when I sync, the new lines in the Event table added to the parent database in event table but other ie the customers rows are not added: (

    I tried many but I can just if I add a step of synchronizing between the addition of the event and adding the client.

    Thank you to offer me a solution because I know there are?

    excuse my english :)

    Thank you
    • Moved by Hengzhe Li Friday, April 22, 2011 3:15 AM (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Monday, March 23, 2009 11:15 PM

Answers

  • do you have both tables added to the syncTable collection for sync ?
    can you use sql profiler to trace a sync to see what queres were run for the sync ?
    is there any conflict on the clients when applying the changes ? you can hook up with the applyChangeFailed event on the sqlceclientProvider to detect the failures.

    btw, sync service is not support FK creation on client so you need to add the FK in your app after the inital sync or by hooking with the schemaCreated event on the client provider.

    thanks
    Yunwen


    This posting is provided "AS IS" with no warranties, and confers no rights.
    Wednesday, March 25, 2009 10:58 AM
    Moderator

All replies

  • do you have both tables added to the syncTable collection for sync ?
    can you use sql profiler to trace a sync to see what queres were run for the sync ?
    is there any conflict on the clients when applying the changes ? you can hook up with the applyChangeFailed event on the sqlceclientProvider to detect the failures.

    btw, sync service is not support FK creation on client so you need to add the FK in your app after the inital sync or by hooking with the schemaCreated event on the client provider.

    thanks
    Yunwen


    This posting is provided "AS IS" with no warranties, and confers no rights.
    Wednesday, March 25, 2009 10:58 AM
    Moderator
  • Hello,

    yes and i found the solution, the problem was in the order of synchronization tables because once I changed the order in the generated code, everything worked :)

    thanks
    Requinham
    Tuesday, April 14, 2009 10:38 PM
  • Hi,
    I think I may have the same problem. How do you change the order in which the tables are synced?

    Thanks

    Sergio
    Thursday, May 14, 2009 9:33 AM
  • Hi -

    Take a look at this post - the reply right on top by Rafik provides the answer.
    http://social.msdn.microsoft.com/Forums/it-IT/uklaunch2007ado.net/thread/6c2c1075-230b-46e2-ac4c-03564c27adc0

    Thanks
    Deepa
    Deepa ( Microsoft Sync Framework)
    Thursday, May 14, 2009 5:33 PM
    Answerer