我成功地完成了对客户端和服务器端的配置。
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
发布于 2014-03-26 10:00:38
它只是模式problem...schema在双方是不同的.我刚刚添加了代码
ServerProvision.ObjectSchema=".dbo";
对我来说很好,谢谢JuneT
https://stackoverflow.com/questions/22552634
复制相似问题