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

SQL Anywhere 10.0.1 » UltraLite - .NET Programming » Understanding UltraLite.NET Development » Synchronization in UltraLite applications

Synchronization in UltraLite applications Next Page

Initiating Synchronization in C# Application


The following code illustrates how to initiate synchronization in an application written in C#.

private void Sync()
{
    // Sync
    try
    {
         // This line would be used to synchronize a specific publication called "high_priority"
         conn.SyncParms.PublicationMask = conn.Schema.GetPublicationSchema("high_priority").Mask;     
                
         // 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);
        }
    }
}