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

SQL Anywhere 12.0.1 » UltraLite - .NET 编程 » UltraLite.NET 应用程序开发 » MobiLink 数据同步

 

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

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



private void Sync( ULConnection conn )
{
    // 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);
         }
}