none
After GenerateSnapshot how can I get ReplicaId? RRS feed

  • Question

  • After I create a CE replica by calling

    SqlCeSyncStoreSnapshotInitialization.GenerateSnapshot() and InitializeSnapshot() with my new SqlCeConnection, I need to get the replicaId for the new replica. How can I access it?

    Thursday, July 15, 2010 3:21 PM

Answers

  • Here's how I solved it:

     

     

    private string GetReplicaId(SqlCeConnection cxcn)

    {

    SqlCeSyncProvider cxcnProvider = ConfigureCESyncProvider(cxcn);

     

    uint batchSize = 0;

    SyncKnowledge knowledge =

    new SyncKnowledge();

    cxcnProvider.GetSyncBatchParameters(

    out batchSize, out knowledge);

     

    string replicaId = knowledge.ReplicaId.ToString();

    cxcnProvider.Dispose();

     

    return replicaId;

    }

    • Marked as answer by wwaters Thursday, July 15, 2010 4:26 PM
    Thursday, July 15, 2010 4:26 PM