none
Provisioning Problem? RRS feed

  • Question

  • Hi, I have a problem using MSF 2.1. I am going to sync MS-SQL server 2008 and SQL compact 3.5. This runs on WCF service.

    I am trying to sync 3 tables: roles, users and companies.

    Now It works well, but After adding a new column in users table, the new column doesn't work during sync.

    "Column 'UserImage' does not belong to table Users." is shown at the  statement "SyncOperationStatistics stats = orchestrator.Synchronize();"

    But I can view the 'UserImage' in CE database and Sql database.

    When adding a new column in any table, same issue is occured.

    This is a code snip for provisioning.

                DbSyncScopeDescription scopeDesc = new DbSyncScopeDescription(str_ScopeName);
                SqlSyncScopeProvisioning serverConfig = new SqlSyncScopeProvisioning((SqlConnection)provider.Connection);

                //determine if this scope already exists on the server and if not go ahead and provision
                if (!serverConfig.ScopeExists(str_ScopeName))
                {

                    scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("Roles", (System.Data.SqlClient.SqlConnection)provider.Connection));
                    scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("Companies", (System.Data.SqlClient.SqlConnection)provider.Connection));
                    scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("Users", (System.Data.SqlClient.SqlConnection)provider.Connection));


                    serverConfig.PopulateFromScopeDescription(scopeDesc);
                   
                    serverConfig.SetCreateTableDefault(DbSyncCreationOption.Skip);

                    serverConfig.Apply();

                }

    why can't I add a new column? Will be appreciate for any help.

    Thanks for your attention.

    Best Regards

    Thursday, December 30, 2010 3:00 AM

Answers

  • Hi,

    Currently SqlSyncProvider doesn't have a easy way to support sync schema change. This is a feature on our plan. The currently supported way is you will need to deprovision the scope and reprovision from scratch. This is not the optimal way but to support schema changes,  many things need to be considered for us to release a feature like that.

    Thanks.

    • Marked as answer by Leonardo Lee Thursday, December 30, 2010 9:33 PM
    Thursday, December 30, 2010 6:20 PM
    Answerer

All replies