Reputation: 919
I successfully done with provision on both side client and server
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");
and when I call this code for the first time 1st if(line no. 2)
and 2nd if(line no. 8)
gets executed and if I call this code 2nd time then 1st else(line no.4)
get executed as client is already provisioned
but here it execute 2nd if(line no. 8)
instead of executing 2nd else(line no. 10)
and throws an exception at line no. 9 serverprovision.Apply(); "There is already an object named 'schema_info' in the database."
And if i try to synchronize then it throws an exception at line 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."
Is this privilege problem or anything else. If this is privilege problem then why it is allow provision for the 1st time?????
-- Server Side DB(database1) --
database1.TableName_tracking
dbo.TableName
-- Client Side DB(database1) --
dbo.TableName_tracking
dbo.TableName
Upvotes: 2
Views: 868
Reputation: 919
It was just schema problem...schema on both side was different...i just added code
ServerProvision.ObjectSchema=".dbo";
and it worked fine for me Thanks JuneT
Upvotes: 2