Answered by:
Error Invalid object name 'scope_info while synchronising

Question
-
I am able to do sync sucessfully. when i added few more tables to scope i am getting following error Invalid object name 'scope_info
I alresy deleted SP and triggers created by sync and tried to run the sync, Again i am getting same error no clue.
Any Idea Please
lavanyarWednesday, October 20, 2010 10:16 PM
Answers
-
the Sync Fx 2.1 install comes with a documentation that contains a walkthrough/tutorial for doing provisioning and synchronization, i suggest you start from there.
you're code above seems ok.
- Marked as answer by Lavanyr Thursday, October 21, 2010 5:39 PM
Thursday, October 21, 2010 5:20 PM
All replies
-
are you adding additional tables to an existing scope?
have you tried deprovisioning the database via DeprovisionStore method?
Thursday, October 21, 2010 12:34 AM -
1. Yes, I am trying to add additional tables. Firstly i deleted all tables(SP, triggers, tracking,scopeinfo) in sql server and Sql Ce created by Sync framework.
2. No.
IS This method removes all metadata in SQLserver?
In my App i am storing metadata in localmachine
srcProvider.BatchingDirectory = Environment.ExpandEnvironmentVariables("%TEMP%");
I am not sure whether temp data is stored in local machine or Sql server?
Thanks
Lavanya
lavanyarThursday, October 21, 2010 1:40 AM -
the DeprovisionStore method takes care of cleaning up/removing all Sync Fx created objects when provisioning. this includes the tables, triggers and stored procedures created by provisioning so you dont have to manually remove them from the database.
the BatchingDirectory doesnt store metadata, its just a location for spooling the files when batching is enabled.
Thursday, October 21, 2010 2:12 AM -
Thanks fo reply i am able to remove meta data but Getting the following Error.
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.
StackTrace:
at Microsoft.Synchronization.Data.SqlServer.SqlManagementUtils.VerifyRuntimeAndSchemaVersionsMatch(SqlConnection connection, SqlTransaction trans, String objectPrefix, String objectSchema, Boolean throwWhenNotProvisioned)
at Microsoft.Synchronization.Data.SqlServer.SqlSyncDescriptionBuilder.GetDescriptionForScope(String scopeName, String objectPrefix, String objectSchema, SqlConnection connection)
at Microsoft.Synchronization.Data.SqlServer.SqlSyncDescriptionBuilder.GetDescriptionForScope(String scopeName, String objectPrefix, SqlConnection connection)
at Microsoft.Synchronization.Data.SqlServer.SqlSyncDescriptionBuilder.GetDescriptionForScope(String scopeName, SqlConnection connection)
at WcfSyncService.SqlSyncService.GetScopeDescription() in C:\Documents and Settings\Desktop\SyncApp\WcfSyncService\SqlSyncService.svc.cs:line 38
at SyncInvokeGetScopeDescription(Object , Object[] , Object[] )
at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
Thanks
Lavanya
lavanyarThursday, October 21, 2010 2:29 PM -
can you post the code snippet where you're getting this error?
Thursday, October 21, 2010 3:18 PM -
Code snippet:
public DbSyncScopeDescription GetScopeDescription()
{
//I am getting runtime error over here dbprovider containing the SQL (sever side) conbfiguration
DbSyncScopeDescription scopeDesc = SqlSyncDescriptionBuilder.GetDescriptionForScope("sales", (SqlConnection)this.dbProvider.Connection);
return scopeDesc;
}
I also tried to delete the metadata created by sync framework and tried to run this code i am getting same error for server DB but for client DB it is good(i.e all sync tables are deletd).
SqlSyncProvider provider = new SqlSyncProvider();
provider.ScopeName = "sales";
provider.Connection = new SqlConnection("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
SqlSyncScopeDeprovisioning clientSqlDepro = new SqlSyncScopeDeprovisioning((System.Data.SqlClient.SqlConnection)provider.Connection);
clientSqlDepro.DeprovisionStore();
Thanks
Lavanya
lavanyarThursday, October 21, 2010 3:31 PM -
have you deleted the sync objects manually or have you used DeprovisionStore?
before calling GetDescriptionForScope, can you confirm that the scope do exist?
Thursday, October 21, 2010 4:07 PM -
1. Used DeprovisionStore
2. After i hit error i checked the both DB tables created On Server (there are no extra tables created). But on Client side Scema_info, Scope_config, Scope_info is created.
Note: I tried to run DeprovisionStore method on Server i get this Error
DbNotProvisionedException was unhandled
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.
StackTrace
at Microsoft.Synchronization.Data.SqlServer.SqlManagementUtils.VerifyRuntimeAndSchemaVersionsMatch(SqlConnection connection, SqlTransaction trans, String objectPrefix, String objectSchema, Boolean throwWhenNotProvisioned)
at Microsoft.Synchronization.Data.SqlServer.SqlSyncScopeDeprovisioning.DeprovisionStore()
at SyncApp.Form1.Form1_Load(Object sender, EventArgs e) in C:\Documents and Settings\T93HH31\Desktop\SyncApp\SqlSyncWinApp\Form1.cs:line 34
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow)
at System.Windows.Forms.Control.SetVisibleCore(Boolean value)
at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
at System.Windows.Forms.Control.set_Visible(Boolean value)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at SyncApp.Program.Main() in C:\Documents and Settings\Desktop\SyncApp\SqlSyncWinApp\Program.cs:line 18
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Thanks
lavanyarThursday, October 21, 2010 4:21 PM -
you cannot run DeprovisionStore against a database if it wasnt provisioned before or it has been deprovisioned already or if you have manually removed the sync objects already.Thursday, October 21, 2010 4:30 PM
-
My bad i did not created scope on server side firstly. previously i execute some scripts to create scope on server side (But it is in sync2.0).
Later i updated Dll to Sync2.1 were i am getting version conflicts.
Can i get some guidance. Is this right way to create scope programtically on Server
private SqlSyncProvider ConfigureRemoteSqlSyncProvider()
{
SqlSyncProvider provider = new SqlSyncProvider();
provider.ScopeName = "sales";
provider.Connection = new SqlConnection("XXX");
DbSyncScopeDescription scopeDesc = new DbSyncScopeDescription("sales");
//class to be used to provision the scope defined above
SqlSyncScopeProvisioning serverConfig = new SqlSyncScopeProvisioning();
if (!serverConfig.ScopeExists("sales", (System.Data.SqlClient.SqlConnection)provider.Connection))
{
//add the approrpiate tables to this scope
scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("orders", (System.Data.SqlClient.SqlConnection)provider.Connection));
//note that it is important to call this after the tables have been added to the scope
serverConfig.PopulateFromScopeDescription(scopeDesc);
//indicate that the base table already exists and does not need to be created
serverConfig.SetCreateTableDefault(DbSyncCreationOption.Skip);
//provision the server
serverConfig.Apply((System.Data.SqlClient.SqlConnection)provider.Connection);
} return provider;
}
lavanyarThursday, October 21, 2010 4:56 PM -
the Sync Fx 2.1 install comes with a documentation that contains a walkthrough/tutorial for doing provisioning and synchronization, i suggest you start from there.
you're code above seems ok.
- Marked as answer by Lavanyr Thursday, October 21, 2010 5:39 PM
Thursday, October 21, 2010 5:20 PM