Beispiel #1
0
        private void PrepareReplica_ExecuteCode(object sender, EventArgs e)
        {
            SyncDatabase db = new SyncDatabase(
                new FbConnection("Database=fdb:/var/db/ch_bl_s.fdb;User=SYSDBA;Password=3Ky1u6nd;Charset=WIN1251"));

            db.StartSession(SessionMode.Read);

            SyncLogReplicaInfo replicaInfo = db.SourcePrepare(db.GetSyncLink(0));

            //SyncLogReplica replica = db.SourceGetNextReplica(replicaInfo, false) as SyncLogReplica;
            //replica.Serialize("c:\\test.replica", true);
            db.EndSession(true);
        }
Beispiel #2
0
        private void test_ExecuteCode(object sender, EventArgs e)
        {
            SyncLogReplica  replica1;
            BinaryFormatter bf = new BinaryFormatter();

            using (FileStream fs = new FileStream(@"C:\test.replica", FileMode.Open, FileAccess.Read))
            {
                replica1 = SyncLogReplica.Deserialize(fs);
            }

            SyncDatabase db2 = new SyncDatabase(
                new FbConnection("Database=fdb:/var/db/ch_bl_s2.fdb;User=SYSDBA;Password=3Ky1u6nd;Charset=WIN1251"));

            db2.StartSession(SessionMode.Write);

            //db2.TargetProcessReplica(replica1, false);

            db2.EndSession(true);

            // - - -
        }