Problem with SqlCeSyncScopeProvisioning

Verrouillé Problem with SqlCeSyncScopeProvisioning

  • mercredi 18 novembre 2009 21:02
     
     
    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:
    • Déplacé Max Wang_Chinasoft mercredi 20 avril 2011 00:17 Forum consolidation (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    •  

Toutes les réponses

  • jeudi 19 novembre 2009 20:48
     
     Traitée
    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
  • lundi 14 décembre 2009 22:44
     
     Traitée
    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
    • Marqué comme réponse don.kirby lundi 14 décembre 2009 22:45
    •