我成功完成了客户端和服务器端的配置
1 clientProvision = new SqlSyncScopeProvisioning(clientConn, tableScope);
2 if (!clientProvision.ScopeExists("Scope1"))
3 clientProvision.Apply();
4 else
5 messagebox("Scope already exist on client side");
6
7 serverProvision = new SqlSyncScopeProvisioning(serverConn, tableScope);
8 if (!serverProvision.ScopeExists("Scope1"))
9 serverProvision.Apply();
10 else
11 messagebox("Scope already exist on server side");
当我第一次调用此代码时1st if(line no. 2)
和2nd if(line no. 8)
被执行,如果我第二次调用此代码,那么1st else(line no.4)
将被执行,因为客户端是already provisioned
但是这里执行2nd if(line no. 8)
而不是执行2nd else(line no. 10)
和throws an exception at line no. 9 serverprovision.Apply(); "There is already an object named 'schema_info' in the database."
如果我尝试同步,则会在第syncOrchestrator.Synchronize();
行"The current operation could not be completed because the database is not provisioned for sync or you not have permissions to the sync configuration tables."
这是特权问题还是其他问题。如果这是特权问题那么为什么它允许第一次提供?????
-- Server Side DB(database1) --
database1.TableName_tracking
dbo.TableName
-- Client Side DB(database1) --
dbo.TableName_tracking
dbo.TableName
答案 0 :(得分:2)
这只是架构问题......两边的架构都不同......我只是添加了代码
ServerProvision.ObjectSchema=".dbo";
这对我来说很好,谢谢JuneT