Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void SetUp(string _pScopeName, DbSyncTableDescription _pDbSyncTable, SqlConnection serverConn, SqlConnection clientConn)
- {
- // Create a scope named "_ITEM" and add tables to it.
- DbSyncScopeDescription productScope = new DbSyncScopeDescription(_pScopeName);
- // Define the Products table.
- // Add the Table to the scope object.
- productScope.Tables.Add(_pDbSyncTable);
- // Create a provisioning object for "_ITEM" and apply it to the on-premise database if one does not exist.
- SqlSyncScopeProvisioning serverProvision = new SqlSyncScopeProvisioning(serverConn, productScope);
- serverProvision.ObjectSchema = ".dbo";
- string _tblName = _pDbSyncTable.LocalName.Replace("[", "").Replace("]", "");
- serverProvision.SetCreateTableDefault(DbSyncCreationOption.Skip);
- serverProvision.Tables[_tblName].AddFilterColumn("_WORKGROUPNAME");
- serverProvision.Tables[_pDbSyncTable.LocalName].FilterClause = "[" + _tblName + "].[_WORKGROUPNAME] = " + _CCompanyVar._WORKGROUPNAME;
- //Skip create Sync Framework objects because we have already created them on the previous step
- serverProvision.SetCreateTableDefault(DbSyncCreationOption.Skip);
- //Create new select changes procedure for our scope
- serverProvision.SetCreateProceduresForAdditionalScopeDefault(DbSyncCreationOption.Create);
- if (_CPubVar._Stop_bool)
- {
- return;
- }
- if (!serverProvision.ScopeExists(_pScopeName))
- serverProvision.Apply();
- // Provision the SQL client database from the on-premise SQL Server database if one does not exist.
- SqlSyncScopeProvisioning clientProvision = new SqlSyncScopeProvisioning(clientConn, productScope);
- if (_CPubVar._Stop_bool)
- {
- return;
- }
- if (!clientProvision.ScopeExists(_pScopeName))
- clientProvision.Apply();
- }
- The multi-part identifier "_ATTENDANCESTATUS._WORKGROUPNAME" could not be bound.
- Invalid column name 'FPR'.
- serverProvision.Apply();
- string _tblName = _pDbSyncTable.LocalName.Replace("[", "").Replace("]", "");
- serverProvision.SetCreateTableDefault(DbSyncCreationOption.Skip);
- serverProvision.Tables[_tblName].AddFilterColumn("_WORKGROUPNAME");
- serverProvision.Tables[_pDbSyncTable.LocalName].FilterClause = "[" + _tblName + "].[_WORKGROUPNAME] = " + _CCompanyVar._WORKGROUPNAME;
- //Skip create Sync Framework objects because we have already created them on the previous step
- serverProvision.SetCreateTableDefault(DbSyncCreationOption.Skip);
- //Create new select changes procedure for our scope
- serverProvision.SetCreateProceduresForAdditionalScopeDefault(DbSyncCreationOption.Create);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement