[英]Implement SqliteClientSyncProvider in Client & Server Synchronization Scenario?
I want to implement a Client(SQLite) & Server(SQL Server) Synchronization application using MS Sync Framework and SqliteClientSyncProvider ( http://sourceforge.net/projects/sqliteclientsyn/ ) 我想使用MS Sync Framework和SqliteClientSyncProvider( http://sourceforge.net/projects/sqliteclientsyn/ )来实现Client(SQLite)和Server(SQL Server)同步应用程序
syncOrchestrator = new SyncOrchestrator();
syncOrchestrator.LocalProvider = new SqliteClientSyncProvider(clientSqlConn);
syncOrchestrator.RemoteProvider = new SqlSyncProvider("filtered_customer", serverConn, null, "Sync");
syncOrchestrator.Direction = SyncDirectionOrder.UploadAndDownload;
syncStats = syncOrchestrator.Synchronize();
After Synchronize() execution a got an InvalidCastExcpetion : 执行Synchronize()之后,得到一个InvalidCastExcpetion:
InvalidCastExcpetion : Microsoft.Synchronisation.KnowledgeSyncProvider
Any advice ? 有什么建议吗?
you have to use the SyncAgent instead of the SyncOrchestrator. 您必须使用SyncAgent而不是SyncOrchestrator。 The SqlLiteClientSyncProvider is an older anchor-based offline provider that doesn't use the newer knowledge-based peer-to-peer type of sync provider. SqlLiteClientSyncProvider是一个较旧的基于锚的脱机提供程序,它不使用更新的基于知识的对等类型的同步提供程序。
in you example above, you can't mix and match providers as well. 在上面的示例中,您也无法混合和匹配提供程序。 so if you're using SQL Server for the remote provider part, you must use the older DBServerSyncProvider as well. 因此,如果将SQL Server用于远程提供程序部分,则还必须使用较旧的DBServerSyncProvider。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.