locked
Problem with SqlCeSyncScopeProvisioning RRS feed

  • Question

  • while attempting to provision sqlce data provider using code below, the ceConfig.Apply(ceConn); method throws the error:
    "The specified index does not exist. [ sysChangeTxBsn_idx ]"
    Any help would be much appreciated.


       private void CheckIfProviderNeedsSchema(SqlCeSyncProvider localProvider)
        {
          if (localProvider != null)
          {
            SqlCeSyncScopeProvisioning ceConfig = new SqlCeSyncScopeProvisioning();
            SqlCeConnection ceConn = (SqlCeConnection)localProvider.Connection;
            string scopeName = localProvider.ScopeName;
            if (!ceConfig.ScopeExists(scopeName, ceConn))
            {
              DbSyncScopeDescription scopeDesc = SqlSyncDescriptionBuilder.GetDescriptionForScope("push", dbAction.ServerConnection);

              //            ceSharingForm.providersCollection["Server"]).Connection);
              ceConfig.PopulateFromScopeDescription(scopeDesc);
              ceConfig.Apply(ceConn);
            }
          }
        }


    System.Data.SqlServerCe.SqlCeException was caught
      Message="The specified index does not exist. [ sysChangeTxBsn_idx ]"
      Source="SQL Server Compact ADO.NET Data Provider"
      HResult=-2147217867
      NativeError=0
      StackTrace:
           at System.Data.SqlServerCe.SqlCeCommand.ProcessResults(Int32 hr)
           at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommandText(IntPtr& pCursor, Boolean& isBaseTableCursor)
           at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand(CommandBehavior behavior, String method, ResultSetOptions options)
           at System.Data.SqlServerCe.SqlCeCommand.ExecuteNonQuery()
           at Microsoft.Synchronization.Data.SqlServerCe.SqlCeSyncTableHelper.DisableOcsTracking(SqlCeTransaction trans)
           at Microsoft.Synchronization.Data.SqlServerCe.SqlCeSyncTableHelper.DropTable(SqlCeTransaction trans)
           at Microsoft.Synchronization.Data.SqlServerCe.SqlCeSyncTableProvisioning.Apply(SqlCeTransaction trans)
           at Microsoft.Synchronization.Data.SqlServerCe.SqlCeSyncScopeProvisioning.Apply(SqlCeConnection connection)
           at Acosta.Push.mSync.Controller.SynchronizationHelper.CheckIfProviderNeedsSchema(SqlCeSyncProvider localProvider) in C:\Dev\Acosta.Push.mSync.Controller\SynchronizationHelper.cs:line 63
           at Acosta.Push.mSync.Controller.SynchronizationHelper.SynchronizeProviders(RelationalSyncProvider localProvider, RelationalSyncProvider remoteProvider) in C:\Dev\Acosta.Push.mSync.Controller\SynchronizationHelper.cs:line 38
           at Acosta.Push.mSync.PersonalConsole.Documents.btSync_Click(Object sender, EventArgs e) in C:\Dev\Acosta.Push.mSync.PersonalConsole\Acosta.Push.mSync.PersonalConsole\Documents.cs:line 283
      InnerException:
    • Moved by Max Wang_1983 Wednesday, April 20, 2011 12:17 AM Forum consolidation (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Wednesday, November 18, 2009 9:02 PM

Answers

  • Hi Don,
       Is the Ce database empty or created fresh? If not, please check if there is any existing *table* in CE db that is also part of scope your are trying to apply.

    thanks
    Jandeep
    jandeepc
    Thursday, November 19, 2009 8:48 PM
  • Thanks Jandeep,

    I sovled this. The issue was because of an old db from a previous version of the sync framework. After dumping the old db I was able to provision and carry on without issue.

    Thanks
    • Marked as answer by don.kirby Monday, December 14, 2009 10:45 PM
    Monday, December 14, 2009 10:44 PM

All replies

  • Hi Don,
       Is the Ce database empty or created fresh? If not, please check if there is any existing *table* in CE db that is also part of scope your are trying to apply.

    thanks
    Jandeep
    jandeepc
    Thursday, November 19, 2009 8:48 PM
  • Thanks Jandeep,

    I sovled this. The issue was because of an old db from a previous version of the sync framework. After dumping the old db I was able to provision and carry on without issue.

    Thanks
    • Marked as answer by don.kirby Monday, December 14, 2009 10:45 PM
    Monday, December 14, 2009 10:44 PM