Simple example application using the ISync.NET API

This topic includes an example which provides a quick reference of how to use the ISync.NET API.

// Synchronization properties
private Hashtable userProps = new Hashtable();
 
// Get an instance DB2eISyncProvider 
ISyncProvider provider = DB2eISyncProvider.GetInstance();
 
// Set up properties
userProps.Add("isync.user", username);
userProps.Add("isync.password", password);
 
// Get an instance of synchronization service from the provider
ISyncService service = provider.CreateSyncService(http://localhost:80, userProps);
 
// Get an instance of the configuration store
ISyncConfigStore config = service.GetConfigStore(data);
 
// Get an instance of the sync driver to perform synchronization
ISyncDriver syncer = config.GetSyncDriver(); 
    
// Perform synchronization
syncer.Sync();
 
// Close objects
syncer.Close();
config.Close();
service.Close();

Related concepts

Related tasks