Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 (中文) » UltraLite - .NET 编程 » 了解 UltraLite.NET 开发 » UltraLite 应用程序中的同步

 

在 C# 应用程序中启动同步

以下代码说明了如何在使用 C# 编写的应用程序中启动同步。

private void Sync()
{
    // Sync
    try
    {
         // setup to synchronize a publication named "high_priority"
         conn.SyncParms.Publications = "high_priority";     
                
         // Set the synchronization parameters 
         conn.SyncParms.Version     = "Version1";
         conn.SyncParms.StreamParms = "";
         conn.SyncParms.Stream      = ULStreamType.TCPIP;
         conn.SyncParms.UserName    = "51";
         conn.Synchronize();
    }     
    catch (System.Exception t)
         {
           MessageBox.Show("Exception: " + t.Message);
         }
}