locked
Sorting tables that are grouped RRS feed

  • Question

  • I require tables to be uploaded in a certain order as the server has many Foreign Keys on different tables (Task table must be uploaded before Cost table due to these foreign keys).

     

    When I add tables to the sync (Configuration.SyncTables.Add(myTable)) it will sync in the order I add them.

     

    Now I need to get them to commit at the same time, so I use a group...  This is where I get problems.

     

    When I assign the tables to a group (Configuration.SyncTables[myTable].SyncGroup = mySyncGroup) I can no longer set the order that the tables upload, its as if they are sorted alphabetically (which is bad for me as Table_Cost comes before Table_Task).

     

    Thankyou


    • Moved by Hengzhe Li Friday, April 22, 2011 5:51 AM (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Tuesday, January 20, 2009 9:10 AM

All replies

  • please make sure your tables are in the same group. that is how you can order the tables. otherwise, as you observed, it will be applied in different group in differnt transactions,

     

    thanks

    Yunwen

     

    • Unmarked as answer by Omad Tuesday, February 3, 2009 1:38 AM
    Tuesday, January 27, 2009 6:06 AM
    Moderator
  • Not sure I understand...

    Example assing two tables to the sync (Bold = code, Italic = Order tables are synced)

    When tables are not grouped
    Configuration.SyncTables.Add("TASKINFO");
    Configuration.SyncTables.Add("COSTINFO");
    >TASKINFO
    >COSTINFO

    When tables are grouped
    Configuration.SyncTables.Add("TASKINFO");
    Configuration.SyncTables["TASKINFO"].SyncGroup = "SyncGroup";
    Configuration.SyncTables.Add("COSTINFO");
    Configuration.SyncTables["COSTINFO"].SyncGroup = "SyncGroup";
    >COSTINFO
    >TASKINFO

    I want the order of my tables in the "SncGroup" to work just like they do ungrouped.

    Thankyou
    Tuesday, February 3, 2009 1:37 AM