gpt4 book ai didi

database - syncOrchestrator.Synchronize();抛出异常

转载 作者:搜寻专家 更新时间:2023-10-30 20:27:51 27 4
gpt4 key购买 nike

我在客户端和服务器端都成功完成了配置

 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

最佳答案

这只是架构问题...双方的架构不同...我只是添加了代码

ServerProvision.ObjectSchema=".dbo";

对我来说效果很好谢谢 JuneT

关于database - syncOrchestrator.Synchronize();抛出异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22552634/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com