首页 新闻 会员 周边 捐助

数据同步问题

1
悬赏园豆:50 [已解决问题] 解决于 2012-07-02 17:05

在项目中使用Sync Framework 2.1安装SDK中的示例代码操作。同步的时候数据库架构能够从服务器获取,并且在客户端中创建成功。但是就是不能同步数据... 比较郁闷:(

运行过程中没有报错。

客户端代码:

using (SqlCeConnection con = new SqlCeConnection(Client_DataTier.Data_Share.LocalConStr))
            {
               

                if (!File.Exists(con.Database))
                {
                    SqlCeEngine engine = new SqlCeEngine(con.ConnectionString);
                    engine.CreateDatabase();
                  }
            }

            //开始同步
            SqlCeClientSyncProvider clientSyncProvider = new SqlCeClientSyncProvider(Client_DataTier.Data_Share.LocalConStr);

            ServiceReference1.SyncServiceClient serviceReferences = null;
            try
            {
                serviceReferences = new ServiceReference1.SyncServiceClient();
            }
            catch (Exception ex)
            {
                MessageBox.Show("发生错误:\r\n" + ex.Message);
                App_Code.ExceptionHelper.ExceptionToDB(ex);
                BGW_SyncLoadDB.ReportProgress(0, ex.Message);
                return;
            }
            if (serviceReferences == null)
            {
                return;
            }




            ServerSyncProviderProxy syncProxy = new ServerSyncProviderProxy(serviceReferences);

            SyncAgent Agent = new SyncAgent();
            Agent.LocalProvider = clientSyncProvider;
            Agent.RemoteProvider = syncProxy;

            BGW_SyncLoadDB.ReportProgress(0, string.Empty);
            clientSyncProvider.ApplyChangeFailed += new EventHandler<ApplyChangeFailedEventArgs>(clientSyncProvider_ApplyChangeFailed);
            clientSyncProvider.SyncProgress += new EventHandler<SyncProgressEventArgs>(clientSyncProvider_SyncProgress);
           
           
            {
                #region 同步设置
                //设置同步组
                SyncGroup AttributeGroup = new SyncGroup("AttributeGroup");

                SyncTable ExceptionManagementTable = new SyncTable("ExceptionManagement");
                ExceptionManagementTable.CreationOption = TableCreationOption.UploadExistingOrCreateNewTable;
                ExceptionManagementTable.SyncDirection = SyncDirection.Bidirectional;
                ExceptionManagementTable.SyncGroup = AttributeGroup;
                Agent.Configuration.SyncTables.Add(ExceptionManagementTable);

                SyncTable TBL_WareHouseTable = new SyncTable("TBL_WareHouse");
                TBL_WareHouseTable.CreationOption = TableCreationOption.UploadExistingOrCreateNewTable;
                TBL_WareHouseTable.SyncDirection = SyncDirection.Bidirectional;
                TBL_WareHouseTable.SyncGroup = AttributeGroup;
                Agent.Configuration.SyncTables.Add(TBL_WareHouseTable);

                SyncTable TBL_SysAreaTable = new SyncTable("TBL_SysArea");
                TBL_SysAreaTable.CreationOption = TableCreationOption.UploadExistingOrCreateNewTable;
                TBL_SysAreaTable.SyncDirection = SyncDirection.Bidirectional;
                TBL_SysAreaTable.SyncGroup = AttributeGroup;
                Agent.Configuration.SyncTables.Add(TBL_SysAreaTable);

                SyncTable TBL_SysRuleTable = new SyncTable("TBL_SysRule");
                TBL_SysRuleTable.CreationOption = TableCreationOption.UploadExistingOrCreateNewTable;
                TBL_SysRuleTable.SyncDirection = SyncDirection.Bidirectional;
                TBL_SysRuleTable.SyncGroup = AttributeGroup;
                Agent.Configuration.SyncTables.Add(TBL_SysRuleTable);

                SyncTable TBL_SysUserStateTable = new SyncTable("TBL_SysUserState");
                TBL_SysUserStateTable.CreationOption = TableCreationOption.UploadExistingOrCreateNewTable;
                TBL_SysUserStateTable.SyncDirection = SyncDirection.Bidirectional;
                TBL_SysUserStateTable.SyncGroup = AttributeGroup;
                Agent.Configuration.SyncTables.Add(TBL_SysUserStateTable);

                SyncTable TBL_SysUserTypeTable = new SyncTable("TBL_SysUserType");
                TBL_SysUserTypeTable.CreationOption = TableCreationOption.UploadExistingOrCreateNewTable;
                TBL_SysUserTypeTable.SyncDirection = SyncDirection.Bidirectional;
                TBL_SysUserTypeTable.SyncGroup = AttributeGroup;
                Agent.Configuration.SyncTables.Add(TBL_SysUserTypeTable);

                SyncTable TBL_SysUserTable = new SyncTable("TBL_SysUser");
                TBL_SysUserTable.CreationOption = TableCreationOption.UploadExistingOrCreateNewTable;
                TBL_SysUserTable.SyncDirection = SyncDirection.Bidirectional;
                TBL_SysUserTable.SyncGroup = AttributeGroup;
                Agent.Configuration.SyncTables.Add(TBL_SysUserTable);

                SyncGroup EmpAttributeGroup = new SyncGroup("EmpAttribute");

                SyncTable TBL_EmployeeSalaryTable = new SyncTable("TBL_EmployeeSalary");
                TBL_EmployeeSalaryTable.CreationOption = TableCreationOption.UploadExistingOrCreateNewTable;
                TBL_EmployeeSalaryTable.SyncDirection = SyncDirection.Bidirectional;
                TBL_EmployeeSalaryTable.SyncGroup = EmpAttributeGroup;
                Agent.Configuration.SyncTables.Add(TBL_EmployeeSalaryTable);

                SyncTable TBL_EmployeePositionTable = new SyncTable("TBL_EmployeePosition");
                TBL_EmployeePositionTable.CreationOption = TableCreationOption.UploadExistingOrCreateNewTable;
                TBL_EmployeePositionTable.SyncDirection = SyncDirection.Bidirectional;
                TBL_EmployeePositionTable.SyncGroup = EmpAttributeGroup;
                Agent.Configuration.SyncTables.Add(TBL_EmployeePositionTable);

                SyncTable TBL_EmployeeStateTable = new SyncTable("TBL_EmployeeState");
                TBL_EmployeeStateTable.CreationOption = TableCreationOption.UploadExistingOrCreateNewTable;
                TBL_EmployeeStateTable.SyncDirection = SyncDirection.Bidirectional;
                TBL_EmployeeStateTable.SyncGroup = EmpAttributeGroup;
                Agent.Configuration.SyncTables.Add(TBL_EmployeeStateTable);

                SyncTable TBL_EmployeeEducationBGTable = new SyncTable("TBL_EmployeeEducationBG");
                TBL_EmployeeEducationBGTable.CreationOption = TableCreationOption.UploadExistingOrCreateNewTable;
                TBL_EmployeeEducationBGTable.SyncDirection = SyncDirection.Bidirectional;
                TBL_EmployeeEducationBGTable.SyncGroup = EmpAttributeGroup;
                Agent.Configuration.SyncTables.Add(TBL_EmployeeEducationBGTable);

                SyncTable TBL_NationTable = new SyncTable("TBL_Nation");
                TBL_NationTable.CreationOption = TableCreationOption.UploadExistingOrCreateNewTable;
                TBL_NationTable.SyncDirection = SyncDirection.Bidirectional;
                TBL_NationTable.SyncGroup = EmpAttributeGroup;
                Agent.Configuration.SyncTables.Add(TBL_NationTable);

                SyncTable TBL_NativePlaceTable = new SyncTable("TBL_NativePlace");
                TBL_NativePlaceTable.CreationOption = TableCreationOption.UploadExistingOrCreateNewTable;
                TBL_NativePlaceTable.SyncDirection = SyncDirection.Bidirectional;
                TBL_NativePlaceTable.SyncGroup = EmpAttributeGroup;
                Agent.Configuration.SyncTables.Add(TBL_NativePlaceTable);

                SyncGroup EmpGroup = new SyncGroup("EmpGroup");

                SyncTable TBL_EmployeeInfoTable = new SyncTable("TBL_EmployeeInfo");
                TBL_EmployeeInfoTable.CreationOption = TableCreationOption.UploadExistingOrCreateNewTable;
                TBL_EmployeeInfoTable.SyncDirection = SyncDirection.Bidirectional;
                TBL_EmployeeInfoTable.SyncGroup = EmpGroup;
                Agent.Configuration.SyncTables.Add(TBL_EmployeeInfoTable);

                SyncTable TBL_EmployeePositionChangeLogTable = new SyncTable("TBL_EmployeePositionChangeLog");
                TBL_EmployeePositionChangeLogTable.CreationOption = TableCreationOption.UploadExistingOrCreateNewTable;
                TBL_EmployeePositionChangeLogTable.SyncDirection = SyncDirection.Bidirectional;
                TBL_EmployeePositionChangeLogTable.SyncGroup = EmpGroup;
                Agent.Configuration.SyncTables.Add(TBL_EmployeePositionChangeLogTable);

                SyncTable TBL_EmployeeSalaryChangeLogTable = new SyncTable("TBL_EmployeeSalaryChangeLog");
                TBL_EmployeeSalaryChangeLogTable.CreationOption = TableCreationOption.UploadExistingOrCreateNewTable;
                TBL_EmployeeSalaryChangeLogTable.SyncDirection = SyncDirection.Bidirectional;
                TBL_EmployeeSalaryChangeLogTable.SyncGroup = EmpGroup;
                Agent.Configuration.SyncTables.Add(TBL_EmployeeSalaryChangeLogTable);

                SyncTable TBL_EmployeeAreaChangeLogTable = new SyncTable("TBL_EmployeeAreaChangeLog");
                TBL_EmployeeAreaChangeLogTable.CreationOption = TableCreationOption.UploadExistingOrCreateNewTable;
                TBL_EmployeeAreaChangeLogTable.SyncDirection = SyncDirection.Bidirectional;
                TBL_EmployeeAreaChangeLogTable.SyncGroup = EmpGroup;
                Agent.Configuration.SyncTables.Add(TBL_EmployeeAreaChangeLogTable);

                SyncGroup AwardGroup = new SyncGroup("AwardGroup");

                SyncTable TBL_AwardTypeTable = new SyncTable("TBL_AwardType");
                TBL_AwardTypeTable.CreationOption = TableCreationOption.UploadExistingOrCreateNewTable;
                TBL_AwardTypeTable.SyncDirection = SyncDirection.Bidirectional;
                TBL_AwardTypeTable.SyncGroup = AwardGroup;
                Agent.Configuration.SyncTables.Add(TBL_AwardTypeTable);

                SyncTable TBL_AwardTalbe = new SyncTable("TBL_Award");
                TBL_AwardTalbe.CreationOption = TableCreationOption.UploadExistingOrCreateNewTable;
                TBL_AwardTalbe.SyncDirection = SyncDirection.Bidirectional;
                TBL_AwardTalbe.SyncGroup = AwardGroup;
                Agent.Configuration.SyncTables.Add(TBL_AwardTalbe);

                SyncTable TBL_AwardAndEmpInfoRelationTable = new SyncTable("TBL_AwardAndEmpInfoRelation");
                TBL_AwardAndEmpInfoRelationTable.CreationOption = TableCreationOption.UploadExistingOrCreateNewTable;
                TBL_AwardAndEmpInfoRelationTable.SyncDirection = SyncDirection.Bidirectional;
                TBL_AwardAndEmpInfoRelationTable.SyncGroup = AwardGroup;
                Agent.Configuration.SyncTables.Add(TBL_AwardAndEmpInfoRelationTable);

                SyncGroup ProjectGroup = new SyncGroup("ProjectGroup");

                SyncTable TBL_Project_Construction_CompanyTable = new SyncTable("TBL_Project_Construction_Company");
                TBL_Project_Construction_CompanyTable.CreationOption = TableCreationOption.UploadExistingOrCreateNewTable;
                TBL_Project_Construction_CompanyTable.SyncDirection = SyncDirection.Bidirectional;
                TBL_Project_Construction_CompanyTable.SyncGroup = ProjectGroup;
                Agent.Configuration.SyncTables.Add(TBL_Project_Construction_CompanyTable);

                SyncTable TBL_Project_Management_CompanyTable = new SyncTable("TBL_Project_Management_Company");
                TBL_Project_Management_CompanyTable.CreationOption = TableCreationOption.UploadExistingOrCreateNewTable;
                TBL_Project_Management_CompanyTable.SyncDirection = SyncDirection.Bidirectional;
                TBL_Project_Management_CompanyTable.SyncGroup = ProjectGroup;
                Agent.Configuration.SyncTables.Add(TBL_Project_Management_CompanyTable);

                SyncTable TBL_ProjectOwnerTable = new SyncTable("TBL_ProjectOwner");
                TBL_ProjectOwnerTable.CreationOption = TableCreationOption.UploadExistingOrCreateNewTable;
                TBL_ProjectOwnerTable.SyncDirection = SyncDirection.Bidirectional;
                TBL_ProjectOwnerTable.SyncGroup = ProjectGroup;
                Agent.Configuration.SyncTables.Add(TBL_ProjectOwnerTable);

                SyncTable TBL_ProjectMissionTable = new SyncTable("TBL_ProjectMission");
                TBL_ProjectMissionTable.CreationOption = TableCreationOption.UploadExistingOrCreateNewTable;
                TBL_ProjectMissionTable.SyncDirection = SyncDirection.Bidirectional;
                TBL_ProjectMissionTable.SyncGroup = ProjectGroup;
                Agent.Configuration.SyncTables.Add(TBL_ProjectMissionTable);

                SyncTable TBL_Project_Sub_TypeTable = new SyncTable("TBL_Project_Sub_Type");
                TBL_Project_Sub_TypeTable.CreationOption = TableCreationOption.UploadExistingOrCreateNewTable;
                TBL_Project_Sub_TypeTable.SyncDirection = SyncDirection.Bidirectional;
                TBL_Project_Sub_TypeTable.SyncGroup = ProjectGroup;
                Agent.Configuration.SyncTables.Add(TBL_Project_Sub_TypeTable);

                SyncTable TBL_Project_SubTable = new SyncTable("TBL_Project_Sub");
                TBL_Project_SubTable.CreationOption = TableCreationOption.UploadExistingOrCreateNewTable;
                TBL_Project_SubTable.SyncDirection = SyncDirection.Bidirectional;
                TBL_Project_SubTable.SyncGroup = ProjectGroup;
                Agent.Configuration.SyncTables.Add(TBL_Project_SubTable);

                SyncTable TBL_ProjectAndMissionRTable = new SyncTable("TBL_ProjectAndMissionR");
                TBL_ProjectAndMissionRTable.CreationOption = TableCreationOption.UploadExistingOrCreateNewTable;
                TBL_ProjectAndMissionRTable.SyncDirection = SyncDirection.Bidirectional;
                TBL_ProjectAndMissionRTable.SyncGroup = ProjectGroup;
                Agent.Configuration.SyncTables.Add(TBL_ProjectAndMissionRTable);

                SyncGroup WorkGroup = new SyncGroup("WorkGroup");

                SyncTable TBL_WorkMissionTable = new SyncTable("TBL_WorkMission");
                TBL_WorkMissionTable.CreationOption = TableCreationOption.UploadExistingOrCreateNewTable;
                TBL_WorkMissionTable.SyncDirection = SyncDirection.Bidirectional;
                TBL_WorkMissionTable.SyncGroup = WorkGroup;
                Agent.Configuration.SyncTables.Add(TBL_WorkMissionTable);

                SyncTable TBL_WorkMissionDetailsTable = new SyncTable("TBL_WorkMissionDetails");
                TBL_WorkMissionDetailsTable.CreationOption = TableCreationOption.UploadExistingOrCreateNewTable;
                TBL_WorkMissionDetailsTable.SyncDirection = SyncDirection.Bidirectional;
                TBL_WorkMissionDetailsTable.SyncGroup = WorkGroup;
                Agent.Configuration.SyncTables.Add(TBL_WorkMissionDetailsTable);

                SyncTable TBL_EmployeeSalarySettlementTable = new SyncTable("TBL_EmployeeSalarySettlement");
                TBL_EmployeeSalarySettlementTable.CreationOption = TableCreationOption.UploadExistingOrCreateNewTable;
                TBL_EmployeeSalarySettlementTable.SyncDirection = SyncDirection.Bidirectional;
                TBL_EmployeeSalarySettlementTable.SyncGroup = WorkGroup;
                Agent.Configuration.SyncTables.Add(TBL_EmployeeSalarySettlementTable);

                SyncTable TBL_EmployeeWorkLogTable = new SyncTable("TBL_EmployeeWorkLog");
                TBL_EmployeeWorkLogTable.CreationOption = TableCreationOption.UploadExistingOrCreateNewTable;
                TBL_EmployeeWorkLogTable.SyncDirection = SyncDirection.Bidirectional;
                TBL_EmployeeWorkLogTable.SyncGroup = WorkGroup;
                Agent.Configuration.SyncTables.Add(TBL_EmployeeWorkLogTable);
                #endregion
                
            }

            SyncStatistics SyncStatis = null;
            try
            {
                SyncStatis = Agent.Synchronize();
            }
            catch (Exception ex)
            {
                MessageBox.Show("发生异常。原因如下:\r\n" + ex.Message);
                App_Code.ExceptionHelper.ExceptionToDB(ex);
                return;
            }

            if (SyncStatis != null)
            {

                MessageBox.Show(string.Format("同步结果:\r\n开始时间:{0}\r\n结束时间:{1}\r\n总共上传记录:{2}条\r\n总共下载记录:{3}条\r\n上载失败记录:{4}条\r\n下载失败记录:{5}条",
                    SyncStatis.SyncStartTime.ToString("yyyy-MM-dd HH:mm:ss"),
                    SyncStatis.SyncCompleteTime.ToString("yyyy-MM-dd HH:mm:ss"),
                    SyncStatis.TotalChangesUploaded,
                    SyncStatis.TotalChangesDownloaded,
                    SyncStatis.UploadChangesFailed,
                    SyncStatis.DownloadChangesFailed));

            }

服务端代码:

View Code
  1 using System;
  2 using System.Collections.Generic;
  3 
  4 using System.Text;
  5 using System.Data;
  6 using System.Data.SqlClient;
  7 using Microsoft.Synchronization;
  8 using Microsoft.Synchronization.Data;
  9 using Microsoft.Synchronization.Data.Server;
 10 
 11 namespace DataSyncService
 12 {
 13     public class ServerSyncProvider : DbServerSyncProvider
 14     {
 15        
 16         public ServerSyncProvider(string ConStr)
 17         {
 18             SqlConnection con = new SqlConnection(ConStr);
 19             this.Connection = con;
 20 
 21 
 22             SqlCommand selectNewAnchorCommand = new SqlCommand();
 23             string newAnchorVariable = "@" + SyncSession.SyncNewReceivedAnchor;
 24             selectNewAnchorCommand.CommandText = string.Format(@"Select {0}=min_active_rowversion()-1", newAnchorVariable);
 25             selectNewAnchorCommand.Parameters.Add(newAnchorVariable, SqlDbType.Timestamp);
 26             selectNewAnchorCommand.Parameters[newAnchorVariable].Direction = ParameterDirection.Output;
 27             selectNewAnchorCommand.Connection = con;
 28             this.SelectNewAnchorCommand = selectNewAnchorCommand;
 29             ///*
 30             #region ExceptionManagement
 31 
 32 
 33             SqlSyncAdapterBuilder ExceptionManagementBuilder = new SqlSyncAdapterBuilder(con);
 34             ExceptionManagementBuilder.TableName = "dbo.ExceptionManagement";
 35             ExceptionManagementBuilder.TombstoneTableName = ExceptionManagementBuilder.TableName + "_Tombstone";
 36             ExceptionManagementBuilder.SyncDirection = SyncDirection.Bidirectional;
 37             ExceptionManagementBuilder.CreationTrackingColumn = "InsertTimestamp";
 38             ExceptionManagementBuilder.UpdateTrackingColumn = "UpdateTimestamp";
 39             ExceptionManagementBuilder.DeletionTrackingColumn = "DeleteTimestamp";
 40 
 41             SyncAdapter ExceptionManagementSyncAdapter = ExceptionManagementBuilder.ToSyncAdapter();
 42             ExceptionManagementSyncAdapter.TableName = "ExceptionManagement";
 43             this.SyncAdapters.Add(ExceptionManagementSyncAdapter);
 44             #endregion
 45 
 46             #region TBL_WareHouse
 47 
 48             SqlSyncAdapterBuilder TBL_WareHouseBuilder = new SqlSyncAdapterBuilder(con);
 49             TBL_WareHouseBuilder.TableName = "dbo.TBL_WareHouse";
 50             TBL_WareHouseBuilder.TombstoneTableName = TBL_WareHouseBuilder.TableName + "_Tombstone";
 51             TBL_WareHouseBuilder.SyncDirection = SyncDirection.Bidirectional;
 52             TBL_WareHouseBuilder.CreationTrackingColumn = "InsertTimestamp";
 53             TBL_WareHouseBuilder.UpdateTrackingColumn = "UpdateTimestamp";
 54             TBL_WareHouseBuilder.DeletionTrackingColumn = "DeleteTimestamp";
 55 
 56             SyncAdapter TBL_WareHouseSyncAdapter = TBL_WareHouseBuilder.ToSyncAdapter();
 57             TBL_WareHouseSyncAdapter.TableName = "TBL_WareHouse";
 58             this.SyncAdapters.Add(TBL_WareHouseSyncAdapter);
 59             #endregion
 60 
 61             #region TBL_SysAreaBuilder
 62             SqlSyncAdapterBuilder TBL_SysAreaBuilder = new SqlSyncAdapterBuilder(con);
 63             TBL_SysAreaBuilder.TableName = "dbo.TBL_SysArea";
 64             TBL_SysAreaBuilder.TombstoneTableName = TBL_SysAreaBuilder.TableName + "_Tombstone";
 65             TBL_SysAreaBuilder.SyncDirection = SyncDirection.Bidirectional;
 66             TBL_SysAreaBuilder.CreationTrackingColumn = "InsertTimestamp";
 67             TBL_SysAreaBuilder.UpdateTrackingColumn = "UpdateTimestamp";
 68             TBL_SysAreaBuilder.DeletionTrackingColumn = "DeleteTimestamp";
 69 
 70             SyncAdapter TBL_SysAreaBuilderSyncAdapter = TBL_SysAreaBuilder.ToSyncAdapter();
 71             TBL_SysAreaBuilderSyncAdapter.TableName = "TBL_SysArea";
 72             this.SyncAdapters.Add(TBL_SysAreaBuilderSyncAdapter);
 73             #endregion
 74 
 75             #region TBL_SysRule
 76             SqlSyncAdapterBuilder TBL_SysRuleBuilder = new SqlSyncAdapterBuilder(con);
 77             TBL_SysRuleBuilder.TableName = "dbo.TBL_SysRule";
 78             TBL_SysRuleBuilder.TombstoneTableName = TBL_SysRuleBuilder.TableName + "_Tombstone";
 79             TBL_SysRuleBuilder.SyncDirection = SyncDirection.Bidirectional;
 80             TBL_SysRuleBuilder.CreationTrackingColumn = "InsertTimestamp";
 81             TBL_SysRuleBuilder.UpdateTrackingColumn = "UpdateTimestamp";
 82             TBL_SysRuleBuilder.DeletionTrackingColumn = "DeleteTimestamp";
 83 
 84             SyncAdapter TBL_SysRuleSyncAdapter = TBL_SysRuleBuilder.ToSyncAdapter();
 85             TBL_SysRuleSyncAdapter.TableName = "TBL_SysRule";
 86             this.SyncAdapters.Add(TBL_SysRuleSyncAdapter);
 87             #endregion
 88 
 89             #region TBL_SysUserState
 90             SqlSyncAdapterBuilder TBL_SysUserStateBuilder = new SqlSyncAdapterBuilder(con);
 91             TBL_SysUserStateBuilder.TableName = "dbo.TBL_SysUserState";
 92             TBL_SysUserStateBuilder.TombstoneTableName = TBL_SysUserStateBuilder.TableName + "_Tombstone";
 93             TBL_SysUserStateBuilder.SyncDirection = SyncDirection.Bidirectional;
 94             TBL_SysUserStateBuilder.CreationTrackingColumn = "InsertTimestamp";
 95             TBL_SysUserStateBuilder.UpdateTrackingColumn = "UpdateTimestamp";
 96             TBL_SysUserStateBuilder.DeletionTrackingColumn = "DeleteTimestamp";
 97 
 98             SyncAdapter TBL_SysUserStateSyncAdapter = TBL_SysUserStateBuilder.ToSyncAdapter();
 99             TBL_SysUserStateSyncAdapter.TableName = "TBL_SysUserState";
100             this.SyncAdapters.Add(TBL_SysUserStateSyncAdapter);
101             #endregion
102 
103             #region TBL_SysUserType
104             SqlSyncAdapterBuilder TBL_SysUserTypeBuilder = new SqlSyncAdapterBuilder(con);
105             TBL_SysUserTypeBuilder.TableName = "dbo.TBL_SysUserType";
106             TBL_SysUserTypeBuilder.TombstoneTableName = TBL_SysUserTypeBuilder.TableName + "_Tombstone";
107             TBL_SysUserTypeBuilder.SyncDirection = SyncDirection.Bidirectional;
108             TBL_SysUserTypeBuilder.CreationTrackingColumn = "InsertTimestamp";
109             TBL_SysUserTypeBuilder.UpdateTrackingColumn = "UpdateTimestamp";
110             TBL_SysUserTypeBuilder.DeletionTrackingColumn = "DeleteTimestamp";
111 
112             SyncAdapter TBL_SysUserTypeSyncAdapter = TBL_SysUserTypeBuilder.ToSyncAdapter();
113             TBL_SysUserTypeSyncAdapter.TableName = "TBL_SysUserType";
114             this.SyncAdapters.Add(TBL_SysUserTypeSyncAdapter);
115             #endregion
116 
117             #region TBL_SysUser
118             SqlSyncAdapterBuilder TBL_SysUserBuilder = new SqlSyncAdapterBuilder(con);
119             TBL_SysUserBuilder.TableName = "dbo.TBL_SysUser";
120             TBL_SysUserBuilder.TombstoneTableName = TBL_SysUserBuilder.TableName + "_Tombstone";
121             TBL_SysUserBuilder.SyncDirection = SyncDirection.Bidirectional;
122             TBL_SysUserBuilder.CreationTrackingColumn = "InsertTimestamp";
123             TBL_SysUserBuilder.UpdateTrackingColumn = "UpdateTimestamp";
124             TBL_SysUserBuilder.DeletionTrackingColumn = "DeleteTimestamp";
125 
126             SyncAdapter TBL_SysUserSyncAdapter = TBL_SysUserBuilder.ToSyncAdapter();
127             TBL_SysUserSyncAdapter.TableName = "TBL_SysUser";
128             this.SyncAdapters.Add(TBL_SysUserSyncAdapter);
129             #endregion
130 
131             #region TBL_EmployeeSalary
132             SqlSyncAdapterBuilder TBL_EmployeeSalaryBuilder = new SqlSyncAdapterBuilder(con);
133             TBL_EmployeeSalaryBuilder.TableName = "dbo.TBL_EmployeeSalary";
134             TBL_EmployeeSalaryBuilder.TombstoneTableName = TBL_EmployeeSalaryBuilder.TableName + "_Tombstone";
135             TBL_EmployeeSalaryBuilder.SyncDirection = SyncDirection.Bidirectional;
136             TBL_EmployeeSalaryBuilder.CreationTrackingColumn = "InsertTimestamp";
137             TBL_EmployeeSalaryBuilder.UpdateTrackingColumn = "UpdateTimestamp";
138             TBL_EmployeeSalaryBuilder.DeletionTrackingColumn = "DeleteTimestamp";
139 
140             SyncAdapter TBL_EmployeeSalarySyncAdapter = TBL_EmployeeSalaryBuilder.ToSyncAdapter();
141             TBL_EmployeeSalarySyncAdapter.TableName = "TBL_EmployeeSalary";
142             this.SyncAdapters.Add(TBL_EmployeeSalarySyncAdapter);
143             #endregion
144 
145             #region TBL_EmployeePosition
146             SqlSyncAdapterBuilder TBL_EmployeePositionBuilder = new SqlSyncAdapterBuilder(con);
147             TBL_EmployeePositionBuilder.TableName = "dbo.TBL_EmployeePosition";
148             TBL_EmployeePositionBuilder.TombstoneTableName = TBL_EmployeePositionBuilder.TableName + "_Tombstone";
149             TBL_EmployeePositionBuilder.SyncDirection = SyncDirection.Bidirectional;
150             TBL_EmployeePositionBuilder.CreationTrackingColumn = "InsertTimestamp";
151             TBL_EmployeePositionBuilder.UpdateTrackingColumn = "UpdateTimestamp";
152             TBL_EmployeePositionBuilder.DeletionTrackingColumn = "DeleteTimestamp";
153 
154             SyncAdapter TBL_EmployeePositionSyncAdapter = TBL_EmployeePositionBuilder.ToSyncAdapter();
155             TBL_EmployeePositionSyncAdapter.TableName = "TBL_EmployeePosition";
156             this.SyncAdapters.Add(TBL_EmployeePositionSyncAdapter);

157             #endregion
158 
159             #region TBL_EmployeeState
160             SqlSyncAdapterBuilder TBL_EmployeeStateBuilder = new SqlSyncAdapterBuilder(con);
161             TBL_EmployeeStateBuilder.TableName = "dbo.TBL_EmployeeState";
162             TBL_EmployeeStateBuilder.TombstoneTableName = TBL_EmployeeStateBuilder.TableName + "_Tombstone";
163             TBL_EmployeeStateBuilder.SyncDirection = SyncDirection.Bidirectional;
164             TBL_EmployeeStateBuilder.CreationTrackingColumn = "InsertTimestamp";
165             TBL_EmployeeStateBuilder.UpdateTrackingColumn = "UpdateTimestamp";
166             TBL_EmployeeStateBuilder.DeletionTrackingColumn = "DeleteTimestamp";
167 
168             SyncAdapter TBL_EmployeeStateSyncAdapter = TBL_EmployeeStateBuilder.ToSyncAdapter();
169             TBL_EmployeeStateSyncAdapter.TableName = "TBL_EmployeeState";
170             this.SyncAdapters.Add(TBL_EmployeeStateSyncAdapter);
171             #endregion
172 
173             #region TBL_EmployeeEducationBG
174             SqlSyncAdapterBuilder TBL_EmployeeEducationBGBuilder = new SqlSyncAdapterBuilder(con);
175             TBL_EmployeeEducationBGBuilder.TableName = "dbo.TBL_EmployeeEducationBG";
176             TBL_EmployeeEducationBGBuilder.TombstoneTableName = TBL_EmployeeEducationBGBuilder.TableName + "_Tombstone";
177             TBL_EmployeeEducationBGBuilder.SyncDirection = SyncDirection.Bidirectional;
178             TBL_EmployeeEducationBGBuilder.CreationTrackingColumn = "InsertTimestamp";
179             TBL_EmployeeEducationBGBuilder.UpdateTrackingColumn = "UpdateTimestamp";
180             TBL_EmployeeEducationBGBuilder.DeletionTrackingColumn = "DeleteTimestamp";
181 
182             SyncAdapter TBL_EmployeeEducationBGSyncAdapter = TBL_EmployeeEducationBGBuilder.ToSyncAdapter();
183             TBL_EmployeeEducationBGSyncAdapter.TableName = "TBL_EmployeeEducationBG";
184             this.SyncAdapters.Add(TBL_EmployeeEducationBGSyncAdapter);
185             #endregion
186 
187             #region TBL_Nation
188             SqlSyncAdapterBuilder TBL_NationBuilder = new SqlSyncAdapterBuilder(con);
189             TBL_NationBuilder.TableName = "dbo.TBL_Nation";
190             TBL_NationBuilder.TombstoneTableName = TBL_NationBuilder.TableName + "_Tombstone";
191             TBL_NationBuilder.SyncDirection = SyncDirection.Bidirectional;
192             TBL_NationBuilder.CreationTrackingColumn = "InsertTimestamp";
193             TBL_NationBuilder.UpdateTrackingColumn = "UpdateTimestamp";
194             TBL_NationBuilder.DeletionTrackingColumn = "DeleteTimestamp";
195 
196             SyncAdapter TBL_NationSyncAdapter = TBL_NationBuilder.ToSyncAdapter();
197             TBL_NationSyncAdapter.TableName = "TBL_Nation";
198             this.SyncAdapters.Add(TBL_NationSyncAdapter);
199             #endregion
200 
201             #region TBL_NativePlace
202             SqlSyncAdapterBuilder TBL_NativePlaceBuilder = new SqlSyncAdapterBuilder(con);
203             TBL_NativePlaceBuilder.TableName = "dbo.TBL_NativePlace";
204             TBL_NativePlaceBuilder.TombstoneTableName = TBL_NativePlaceBuilder.TableName + "_Tombstone";
205             TBL_NativePlaceBuilder.SyncDirection = SyncDirection.Bidirectional;
206             TBL_NativePlaceBuilder.CreationTrackingColumn = "InsertTimestamp";
207             TBL_NativePlaceBuilder.UpdateTrackingColumn = "UpdateTimestamp";
208             TBL_NativePlaceBuilder.DeletionTrackingColumn = "DeleteTimestamp";
209 
210             SyncAdapter TBL_NativePlaceSyncAdapter = TBL_NativePlaceBuilder.ToSyncAdapter();
211             TBL_NativePlaceSyncAdapter.TableName = "TBL_NativePlace";
212             this.SyncAdapters.Add(TBL_NativePlaceSyncAdapter);
213             #endregion
214 
215             #region TBL_EmployeeInfo
216             SqlSyncAdapterBuilder TBL_EmployeeInfoBuilder = new SqlSyncAdapterBuilder(con);
217             TBL_EmployeeInfoBuilder.TableName = "dbo.TBL_EmployeeInfo";
218             TBL_EmployeeInfoBuilder.TombstoneTableName = TBL_EmployeeInfoBuilder.TableName + "_Tombstone";
219             TBL_EmployeeInfoBuilder.SyncDirection = SyncDirection.Bidirectional;
220             TBL_EmployeeInfoBuilder.CreationTrackingColumn = "InsertTimestamp";
221             TBL_EmployeeInfoBuilder.UpdateTrackingColumn = "UpdateTimestamp";
222             TBL_EmployeeInfoBuilder.DeletionTrackingColumn = "DeleteTimestamp";
223 
224             SyncAdapter TBL_EmployeeInfoSyncAdapter = TBL_EmployeeInfoBuilder.ToSyncAdapter();
225             TBL_EmployeeInfoSyncAdapter.TableName = "TBL_EmployeeInfo";
226             this.SyncAdapters.Add(TBL_EmployeeInfoSyncAdapter);
227             #endregion
228 
229             #region TBL_EmployeePositionChangeLog
230             SqlSyncAdapterBuilder TBL_EmployeePositionChangeLogBuilder = new SqlSyncAdapterBuilder(con);
231             TBL_EmployeePositionChangeLogBuilder.TableName = "dbo.TBL_EmployeePositionChangeLog";
232             TBL_EmployeePositionChangeLogBuilder.TombstoneTableName = TBL_EmployeePositionChangeLogBuilder.TableName + "_Tombstone";
233             TBL_EmployeePositionChangeLogBuilder.SyncDirection = SyncDirection.Bidirectional;
234             TBL_EmployeePositionChangeLogBuilder.CreationTrackingColumn = "InsertTimestamp";
235             TBL_EmployeePositionChangeLogBuilder.UpdateTrackingColumn = "UpdateTimestamp";
236             TBL_EmployeePositionChangeLogBuilder.DeletionTrackingColumn = "DeleteTimestamp";
237 
238             SyncAdapter TBL_EmployeePositionChangeLogSyncAdapter = TBL_EmployeePositionChangeLogBuilder.ToSyncAdapter();
239             TBL_EmployeePositionChangeLogSyncAdapter.TableName = "TBL_EmployeePositionChangeLog";
240             this.SyncAdapters.Add(TBL_EmployeePositionChangeLogSyncAdapter);
241             #endregion
242 
243             #region TBL_EmployeeSalaryChangeLog
244             SqlSyncAdapterBuilder TBL_EmployeeSalaryChangeLogBuilder = new SqlSyncAdapterBuilder(con);
245             TBL_EmployeeSalaryChangeLogBuilder.TableName = "dbo.TBL_EmployeeSalaryChangeLog";
246             TBL_EmployeeSalaryChangeLogBuilder.TombstoneTableName = TBL_EmployeeSalaryChangeLogBuilder.TableName + "_Tombstone";
247             TBL_EmployeeSalaryChangeLogBuilder.SyncDirection = SyncDirection.Bidirectional;
248             TBL_EmployeeSalaryChangeLogBuilder.CreationTrackingColumn = "InsertTimestamp";
249             TBL_EmployeeSalaryChangeLogBuilder.UpdateTrackingColumn = "UpdateTimestamp";
250             TBL_EmployeeSalaryChangeLogBuilder.DeletionTrackingColumn = "DeleteTimestamp";
251 
252             SyncAdapter TBL_EmployeeSalaryChangeLogSyncAdapter = TBL_EmployeeSalaryChangeLogBuilder.ToSyncAdapter();
253             TBL_EmployeeSalaryChangeLogSyncAdapter.TableName = "TBL_EmployeeSalaryChangeLog";
254             this.SyncAdapters.Add(TBL_EmployeeSalaryChangeLogSyncAdapter);
255             #endregion
256 
257             #region TBL_EmployeeAreaChangeLog
258             SqlSyncAdapterBuilder TBL_EmployeeAreaChangeLogBuilder = new SqlSyncAdapterBuilder(con);
259             TBL_EmployeeAreaChangeLogBuilder.TableName = "dbo.TBL_EmployeeAreaChangeLog";
260             TBL_EmployeeAreaChangeLogBuilder.TombstoneTableName = TBL_EmployeeAreaChangeLogBuilder.TableName + "_Tombstone";
261             TBL_EmployeeAreaChangeLogBuilder.SyncDirection = SyncDirection.Bidirectional;
262             TBL_EmployeeAreaChangeLogBuilder.CreationTrackingColumn = "InsertTimestamp";
263             TBL_EmployeeAreaChangeLogBuilder.UpdateTrackingColumn = "UpdateTimestamp";
264             TBL_EmployeeAreaChangeLogBuilder.DeletionTrackingColumn = "DeleteTimestamp";
265 
266             SyncAdapter TBL_EmployeeAreaChangeLogSyncAdapter = TBL_EmployeeAreaChangeLogBuilder.ToSyncAdapter();
267             TBL_EmployeeAreaChangeLogSyncAdapter.TableName = "TBL_EmployeeAreaChangeLog";
268             this.SyncAdapters.Add(TBL_EmployeeAreaChangeLogSyncAdapter);
269             #endregion
270 
271             #region TBL_AwardType
272             SqlSyncAdapterBuilder TBL_AwardTypeBuilder = new SqlSyncAdapterBuilder(con);
273             TBL_AwardTypeBuilder.TableName = "dbo.TBL_AwardType";
274             TBL_AwardTypeBuilder.TombstoneTableName = TBL_AwardTypeBuilder.TableName + "_Tombstone";
275             TBL_AwardTypeBuilder.SyncDirection = SyncDirection.Bidirectional;
276             TBL_AwardTypeBuilder.CreationTrackingColumn = "InsertTimestamp";
277             TBL_AwardTypeBuilder.UpdateTrackingColumn = "UpdateTimestamp";
278             TBL_AwardTypeBuilder.DeletionTrackingColumn = "DeleteTimestamp";
279 
280             SyncAdapter TBL_AwardTypeSyncAdapter = TBL_AwardTypeBuilder.ToSyncAdapter();
281             TBL_AwardTypeSyncAdapter.TableName = "TBL_AwardType";
282             this.SyncAdapters.Add(TBL_AwardTypeSyncAdapter);
283             #endregion
284 
285             #region TBL_Award
286             SqlSyncAdapterBuilder TBL_AwardBuilder = new SqlSyncAdapterBuilder(con);
287             TBL_AwardBuilder.TableName = "dbo.TBL_Award";
288             TBL_AwardBuilder.TombstoneTableName = TBL_AwardBuilder.TableName + "_Tombstone";
289             TBL_AwardBuilder.SyncDirection = SyncDirection.Bidirectional;
290             TBL_AwardBuilder.CreationTrackingColumn = "InsertTimestamp";
291             TBL_AwardBuilder.UpdateTrackingColumn = "UpdateTimestamp";
292             TBL_AwardBuilder.DeletionTrackingColumn = "DeleteTimestamp";
293 
294             SyncAdapter TBL_AwardSyncAdapter = TBL_AwardBuilder.ToSyncAdapter();
295             TBL_AwardSyncAdapter.TableName = "TBL_Award";
296             this.SyncAdapters.Add(TBL_AwardSyncAdapter);
297             #endregion
298 
299             #region TBL_AwardAndEmpInfoRelation
300             SqlSyncAdapterBuilder TBL_AwardAndEmpInfoRelationBuilder = new SqlSyncAdapterBuilder(con);
301             TBL_AwardAndEmpInfoRelationBuilder.TableName = "dbo.TBL_AwardAndEmpInfoRelation";
302             TBL_AwardAndEmpInfoRelationBuilder.TombstoneTableName = TBL_AwardAndEmpInfoRelationBuilder.TableName + "_Tombstone";
303             TBL_AwardAndEmpInfoRelationBuilder.SyncDirection = SyncDirection.Bidirectional;
304             TBL_AwardAndEmpInfoRelationBuilder.CreationTrackingColumn = "InsertTimestamp";
305             TBL_AwardAndEmpInfoRelationBuilder.UpdateTrackingColumn = "UpdateTimestamp";
306             TBL_AwardAndEmpInfoRelationBuilder.DeletionTrackingColumn = "DeleteTimestamp";
307 
308             SyncAdapter TBL_AwardAndEmpInfoRelationSyncAdapter = TBL_AwardAndEmpInfoRelationBuilder.ToSyncAdapter();
309             TBL_AwardAndEmpInfoRelationSyncAdapter.TableName = "TBL_AwardAndEmpInfoRelation";
310             this.SyncAdapters.Add(TBL_AwardAndEmpInfoRelationSyncAdapter);
311             #endregion
312 
313             #region TBL_Project_Construction_Company
314             SqlSyncAdapterBuilder TBL_Project_Construction_CompanyBuilder = new SqlSyncAdapterBuilder(con);
315             TBL_Project_Construction_CompanyBuilder.TableName = "dbo.TBL_Project_Construction_Company";
316             TBL_Project_Construction_CompanyBuilder.TombstoneTableName = TBL_Project_Construction_CompanyBuilder.TableName + "_Tombstone";
317             TBL_Project_Construction_CompanyBuilder.SyncDirection = SyncDirection.Bidirectional;
318             TBL_Project_Construction_CompanyBuilder.CreationTrackingColumn = "InsertTimestamp";
319             TBL_Project_Construction_CompanyBuilder.UpdateTrackingColumn = "UpdateTimestamp";
320             TBL_Project_Construction_CompanyBuilder.DeletionTrackingColumn = "DeleteTimestamp";
321 
322             SyncAdapter TBL_Project_Construction_CompanySyncAdapter = TBL_Project_Construction_CompanyBuilder.ToSyncAdapter();
323             TBL_Project_Construction_CompanySyncAdapter.TableName = "TBL_Project_Construction_Company";
324             this.SyncAdapters.Add(TBL_Project_Construction_CompanySyncAdapter);
325             #endregion
326 
327             #region TBL_Project_Management_Company
328             SqlSyncAdapterBuilder TBL_Project_Management_CompanyBuilder = new SqlSyncAdapterBuilder(con);
329             TBL_Project_Management_CompanyBuilder.TableName = "dbo.TBL_Project_Management_Company";
330             TBL_Project_Management_CompanyBuilder.TombstoneTableName = TBL_Project_Management_CompanyBuilder.TableName + "_Tombstone";
331             TBL_Project_Management_CompanyBuilder.SyncDirection = SyncDirection.Bidirectional;
332             TBL_Project_Management_CompanyBuilder.CreationTrackingColumn = "InsertTimestamp";
333             TBL_Project_Management_CompanyBuilder.UpdateTrackingColumn = "UpdateTimestamp";
334             TBL_Project_Management_CompanyBuilder.DeletionTrackingColumn = "DeleteTimestamp";
335 
336             SyncAdapter TBL_Project_Management_CompanySyncAdapter = TBL_Project_Management_CompanyBuilder.ToSyncAdapter();
337             TBL_Project_Management_CompanySyncAdapter.TableName = "TBL_Project_Management_Company";
338             this.SyncAdapters.Add(TBL_Project_Management_CompanySyncAdapter);
339             #endregion
340 
341             #region TBL_ProjectOwner
342             SqlSyncAdapterBuilder TBL_ProjectOwnerBuilder = new SqlSyncAdapterBuilder(con);
343             TBL_ProjectOwnerBuilder.TableName = "dbo.TBL_ProjectOwner";
344             TBL_ProjectOwnerBuilder.TombstoneTableName = TBL_ProjectOwnerBuilder.TableName + "_Tombstone";
345             TBL_ProjectOwnerBuilder.SyncDirection = SyncDirection.Bidirectional;
346             TBL_ProjectOwnerBuilder.CreationTrackingColumn = "InsertTimestamp";
347             TBL_ProjectOwnerBuilder.UpdateTrackingColumn = "UpdateTimestamp";
348             TBL_ProjectOwnerBuilder.DeletionTrackingColumn = "DeleteTimestamp";
349 
350             SyncAdapter TBL_ProjectOwnerSyncAdapter = TBL_ProjectOwnerBuilder.ToSyncAdapter();
351             TBL_ProjectOwnerSyncAdapter.TableName = "TBL_ProjectOwner";
352             this.SyncAdapters.Add(TBL_ProjectOwnerSyncAdapter);
353             #endregion
354 
355             #region TBL_ProjectMission
356             SqlSyncAdapterBuilder TBL_ProjectMissionBuilder = new SqlSyncAdapterBuilder(con);
357             TBL_ProjectMissionBuilder.TableName = "dbo.TBL_ProjectMission";
358             TBL_ProjectMissionBuilder.TombstoneTableName = TBL_ProjectMissionBuilder.TableName + "_Tombstone";
359             TBL_ProjectMissionBuilder.SyncDirection = SyncDirection.Bidirectional;
360             TBL_ProjectMissionBuilder.CreationTrackingColumn = "InsertTimestamp";
361             TBL_ProjectMissionBuilder.UpdateTrackingColumn = "UpdateTimestamp";
362             TBL_ProjectMissionBuilder.DeletionTrackingColumn = "DeleteTimestamp";
363 
364             SyncAdapter TBL_ProjectMissionSyncAdapter = TBL_ProjectMissionBuilder.ToSyncAdapter();
365             TBL_ProjectMissionSyncAdapter.TableName = "TBL_ProjectMission";
366             this.SyncAdapters.Add(TBL_ProjectMissionSyncAdapter);
367             #endregion
368 
369             #region TBL_Project_Sub_Type
370             SqlSyncAdapterBuilder TBL_Project_Sub_TypeBuilder = new SqlSyncAdapterBuilder(con);
371             TBL_Project_Sub_TypeBuilder.TableName = "dbo.TBL_Project_Sub_Type";
372             TBL_Project_Sub_TypeBuilder.TombstoneTableName = TBL_Project_Sub_TypeBuilder.TableName + "_Tombstone";
373             TBL_Project_Sub_TypeBuilder.SyncDirection = SyncDirection.Bidirectional;
374             TBL_Project_Sub_TypeBuilder.CreationTrackingColumn = "InsertTimestamp";
375             TBL_Project_Sub_TypeBuilder.UpdateTrackingColumn = "UpdateTimestamp";
376             TBL_Project_Sub_TypeBuilder.DeletionTrackingColumn = "DeleteTimestamp";
377 
378             SyncAdapter TBL_Project_Sub_TypeSyncAdapter = TBL_Project_Sub_TypeBuilder.ToSyncAdapter();
379             TBL_Project_Sub_TypeSyncAdapter.TableName = "TBL_Project_Sub_Type";
380             this.SyncAdapters.Add(TBL_Project_Sub_TypeSyncAdapter);
381             #endregion
382 
383             #region TBL_Project_Sub
384             SqlSyncAdapterBuilder TBL_Project_SubBuilder = new SqlSyncAdapterBuilder(con);
385             TBL_Project_SubBuilder.TableName = "dbo.TBL_Project_Sub";
386             TBL_Project_SubBuilder.TombstoneTableName = TBL_Project_SubBuilder.TableName + "_Tombstone";
387             TBL_Project_SubBuilder.SyncDirection = SyncDirection.Bidirectional;
388             TBL_Project_SubBuilder.CreationTrackingColumn = "InsertTimestamp";
389             TBL_Project_SubBuilder.UpdateTrackingColumn = "UpdateTimestamp";
390             TBL_Project_SubBuilder.DeletionTrackingColumn = "DeleteTimestamp";
391 
392             SyncAdapter TBL_Project_SubSyncAdapter = TBL_Project_SubBuilder.ToSyncAdapter();
393             TBL_Project_SubSyncAdapter.TableName = "TBL_Project_Sub";
394             this.SyncAdapters.Add(TBL_Project_SubSyncAdapter);
395             #endregion
396 
397             #region TBL_ProjectAndMissionR
398             SqlSyncAdapterBuilder TBL_ProjectAndMissionRBuilder = new SqlSyncAdapterBuilder(con);
399             TBL_ProjectAndMissionRBuilder.TableName = "dbo.TBL_ProjectAndMissionR";
400             TBL_ProjectAndMissionRBuilder.TombstoneTableName = TBL_ProjectAndMissionRBuilder.TableName + "_Tombstone";
401             TBL_ProjectAndMissionRBuilder.SyncDirection = SyncDirection.Bidirectional;
402             TBL_ProjectAndMissionRBuilder.CreationTrackingColumn = "InsertTimestamp";
403             TBL_ProjectAndMissionRBuilder.UpdateTrackingColumn = "UpdateTimestamp";
404             TBL_ProjectAndMissionRBuilder.DeletionTrackingColumn = "DeleteTimestamp";
405 
406             SyncAdapter TBL_ProjectAndMissionRSyncAdapter = TBL_ProjectAndMissionRBuilder.ToSyncAdapter();
407             TBL_ProjectAndMissionRSyncAdapter.TableName = "TBL_ProjectAndMissionR";
408             this.SyncAdapters.Add(TBL_ProjectAndMissionRSyncAdapter);
409             #endregion
410 
411             #region TBL_WorkMission
412             SqlSyncAdapterBuilder TBL_WorkMissionBuilder = new SqlSyncAdapterBuilder(con);
413             TBL_WorkMissionBuilder.TableName = "dbo.TBL_WorkMission";
414             TBL_WorkMissionBuilder.TombstoneTableName = TBL_WorkMissionBuilder.TableName + "_Tombstone";
415             TBL_WorkMissionBuilder.SyncDirection = SyncDirection.Bidirectional;
416             TBL_WorkMissionBuilder.CreationTrackingColumn = "InsertTimestamp";
417             TBL_WorkMissionBuilder.UpdateTrackingColumn = "UpdateTimestamp";
418             TBL_WorkMissionBuilder.DeletionTrackingColumn = "DeleteTimestamp";
419 
420             SyncAdapter TBL_WorkMissionSyncAdapter = TBL_WorkMissionBuilder.ToSyncAdapter();
421             TBL_WorkMissionSyncAdapter.TableName = "TBL_WorkMission";
422             this.SyncAdapters.Add(TBL_WorkMissionSyncAdapter);
423             #endregion
424 
425             #region TBL_WorkMissionDetails
426             SqlSyncAdapterBuilder TBL_WorkMissionDetailsBuilder = new SqlSyncAdapterBuilder(con);
427             TBL_WorkMissionDetailsBuilder.TableName = "dbo.TBL_WorkMissionDetails";
428             TBL_WorkMissionDetailsBuilder.TombstoneTableName = TBL_WorkMissionDetailsBuilder.TableName + "_Tombstone";
429             TBL_WorkMissionDetailsBuilder.SyncDirection = SyncDirection.Bidirectional;
430             TBL_WorkMissionDetailsBuilder.CreationTrackingColumn = "InsertTimestamp";
431             TBL_WorkMissionDetailsBuilder.UpdateTrackingColumn = "UpdateTimestamp";
432             TBL_WorkMissionDetailsBuilder.DeletionTrackingColumn = "DeleteTimestamp";
433 
434             SyncAdapter TBL_WorkMissionDetailsSyncAdapter = TBL_WorkMissionDetailsBuilder.ToSyncAdapter();
435             TBL_WorkMissionDetailsSyncAdapter.TableName = "TBL_WorkMissionDetails";
436             this.SyncAdapters.Add(TBL_WorkMissionDetailsSyncAdapter);
437             #endregion
438 
439             #region TBL_EmployeeSalarySettlement
440             SqlSyncAdapterBuilder TBL_EmployeeSalarySettlementBuilder = new SqlSyncAdapterBuilder(con);
441             TBL_EmployeeSalarySettlementBuilder.TableName = "dbo.TBL_EmployeeSalarySettlement";
442             TBL_EmployeeSalarySettlementBuilder.TombstoneTableName = TBL_EmployeeSalarySettlementBuilder.TableName + "_Tombstone";
443             TBL_EmployeeSalarySettlementBuilder.SyncDirection = SyncDirection.Bidirectional;
444             TBL_EmployeeSalarySettlementBuilder.CreationTrackingColumn = "InsertTimestamp";
445             TBL_EmployeeSalarySettlementBuilder.UpdateTrackingColumn = "UpdateTimestamp";
446             TBL_EmployeeSalarySettlementBuilder.DeletionTrackingColumn = "DeleteTimestamp";
447 
448             SyncAdapter TBL_EmployeeSalarySettlementSyncAdapter = TBL_EmployeeSalarySettlementBuilder.ToSyncAdapter();
449             TBL_EmployeeSalarySettlementSyncAdapter.TableName = "TBL_EmployeeSalarySettlement";
450             this.SyncAdapters.Add(TBL_EmployeeSalarySettlementSyncAdapter);
451             #endregion
452 
453             #region TBL_EmployeeWorkLog
454             SqlSyncAdapterBuilder TBL_EmployeeWorkLogBuilder = new SqlSyncAdapterBuilder(con);
455             TBL_EmployeeWorkLogBuilder.TableName = "dbo.TBL_EmployeeWorkLog";
456             TBL_EmployeeWorkLogBuilder.TombstoneTableName = TBL_EmployeeWorkLogBuilder.TableName + "_Tombstone";
457             TBL_EmployeeWorkLogBuilder.SyncDirection = SyncDirection.Bidirectional;
458             TBL_EmployeeWorkLogBuilder.CreationTrackingColumn = "InsertTimestamp";
459             TBL_EmployeeWorkLogBuilder.UpdateTrackingColumn = "UpdateTimestamp";
460             TBL_EmployeeWorkLogBuilder.DeletionTrackingColumn = "DeleteTimestamp";
461 
462             SyncAdapter TBL_EmployeeWorkLogSyncAdapter = TBL_EmployeeWorkLogBuilder.ToSyncAdapter();
463             TBL_EmployeeWorkLogSyncAdapter.TableName = "TBL_EmployeeWorkLog";
464             this.SyncAdapters.Add(TBL_EmployeeWorkLogSyncAdapter);
465             #endregion
466             //*/
467            
468         }
469 
470         
471 
472        
473     }
474 }

数据库脚本:

USE [Sync_ProjectManagementDB]
GO
INSERT INTO [TBL_SysUserState]([USName],[USDesc])VALUES('启用','用户正在使用中');
INSERT INTO [TBL_SysUserState]([USName],[USDesc])VALUES('禁用','用户账户未激活');
GO
INSERT INTO [TBL_SysUser]([UNID],[UName],[UArea],[ULoginName],[ULoginPWD],[UCurrentIP],[ULoginTime],[URules],[UType],[UState])
     VALUES
           (DEFAULT,'系统管理员',null,'admin','admin',NULL,NULL,NULL,1,1)
GO

INSERT INTO [TBL_NativePlace]([NativePlaceName],[NativePlaceFatherID])VALUES('北京市',0)
INSERT INTO [TBL_NativePlace]([NativePlaceName],[NativePlaceFatherID])VALUES('天津市',0)
INSERT INTO [TBL_NativePlace]([NativePlaceName],[NativePlaceFatherID])VALUES('河北省',0)
INSERT INTO [TBL_NativePlace]([NativePlaceName],[NativePlaceFatherID])VALUES('山西省',0)
INSERT INTO [TBL_NativePlace]([NativePlaceName],[NativePlaceFatherID])VALUES('内蒙古',0)
INSERT INTO [TBL_NativePlace]([NativePlaceName],[NativePlaceFatherID])VALUES('辽宁省',0)
INSERT INTO [TBL_NativePlace]([NativePlaceName],[NativePlaceFatherID])VALUES('吉林省',0)
INSERT INTO [TBL_NativePlace]([NativePlaceName],[NativePlaceFatherID])VALUES('黑龙江',0)
INSERT INTO [TBL_NativePlace]([NativePlaceName],[NativePlaceFatherID])VALUES('上海市',0)
INSERT INTO [TBL_NativePlace]([NativePlaceName],[NativePlaceFatherID])VALUES('江苏省',0)
INSERT INTO [TBL_NativePlace]([NativePlaceName],[NativePlaceFatherID])VALUES('浙江省',0)
INSERT INTO [TBL_NativePlace]([NativePlaceName],[NativePlaceFatherID])VALUES('安徽省',0)
INSERT INTO [TBL_NativePlace]([NativePlaceName],[NativePlaceFatherID])VALUES('福建省',0)
INSERT INTO [TBL_NativePlace]([NativePlaceName],[NativePlaceFatherID])VALUES('江西省',0)
INSERT INTO [TBL_NativePlace]([NativePlaceName],[NativePlaceFatherID])VALUES('山东省',0)
INSERT INTO [TBL_NativePlace]([NativePlaceName],[NativePlaceFatherID])VALUES('河南省',0)
INSERT INTO [TBL_NativePlace]([NativePlaceName],[NativePlaceFatherID])VALUES('湖北省',0)
INSERT INTO [TBL_NativePlace]([NativePlaceName],[NativePlaceFatherID])VALUES('湖南省',0)
INSERT INTO [TBL_NativePlace]([NativePlaceName],[NativePlaceFatherID])VALUES('广东省',0)
INSERT INTO [TBL_NativePlace]([NativePlaceName],[NativePlaceFatherID])VALUES('广西省',0)
INSERT INTO [TBL_NativePlace]([NativePlaceName],[NativePlaceFatherID])VALUES('海南省',0)
INSERT INTO [TBL_NativePlace]([NativePlaceName],[NativePlaceFatherID])VALUES('重庆市',0)
INSERT INTO [TBL_NativePlace]([NativePlaceName],[NativePlaceFatherID])VALUES('四川省',0)
INSERT INTO [TBL_NativePlace]([NativePlaceName],[NativePlaceFatherID])VALUES('贵州省',0)
INSERT INTO [TBL_NativePlace]([NativePlaceName],[NativePlaceFatherID])VALUES('云南省',0)
INSERT INTO [TBL_NativePlace]([NativePlaceName],[NativePlaceFatherID])VALUES('西藏省',0)
INSERT INTO [TBL_NativePlace]([NativePlaceName],[NativePlaceFatherID])VALUES('陕西省',0)
INSERT INTO [TBL_NativePlace]([NativePlaceName],[NativePlaceFatherID])VALUES('甘肃省',0)
INSERT INTO [TBL_NativePlace]([NativePlaceName],[NativePlaceFatherID])VALUES('青海省',0)
INSERT INTO [TBL_NativePlace]([NativePlaceName],[NativePlaceFatherID])VALUES('宁夏省',0)
INSERT INTO [TBL_NativePlace]([NativePlaceName],[NativePlaceFatherID])VALUES('新疆省',0)
INSERT INTO [TBL_NativePlace]([NativePlaceName],[NativePlaceFatherID])VALUES('香港',0)
INSERT INTO [TBL_NativePlace]([NativePlaceName],[NativePlaceFatherID])VALUES('澳门',0)
INSERT INTO [TBL_NativePlace]([NativePlaceName],[NativePlaceFatherID])VALUES('台湾省',0)






INSERT INTO [TBL_Nation]([NationName])VALUES ('汉族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('蒙古族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('回族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('藏族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('维吾尔族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('苗族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('彝族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('壮族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('布依族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('朝鲜族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('满族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('侗族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('瑶族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('白族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('土家族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('哈尼族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('哈萨克族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('傣族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('黎族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('傈僳族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('佤族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('畲族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('高山族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('拉祜族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('水族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('东乡族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('纳西族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('景颇族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('柯尔克孜族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('土族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('达斡尔族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('仫佬族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('羌族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('布朗族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('撒拉族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('毛南族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('仡佬族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('锡伯族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('阿昌族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('普米族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('塔吉克族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('怒族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('乌孜别克族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('俄罗斯族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('鄂温克族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('德昂族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('保安族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('裕固族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('京族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('塔塔尔族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('独龙族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('鄂伦春族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('赫哲族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('门巴族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('珞巴族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('基诺族');
INSERT INTO [TBL_Nation]([NationName])VALUES ('其他');
INSERT INTO [TBL_Nation]([NationName])VALUES ('外国血统');

INSERT INTO [TBL_EmployeeEducationBG]([EBGName],[EBGDESC])VALUES('博士研究生',null);
INSERT INTO [TBL_EmployeeEducationBG]([EBGName],[EBGDESC])VALUES('硕士研究生',null);
INSERT INTO [TBL_EmployeeEducationBG]([EBGName],[EBGDESC])VALUES('大学本科',null);
INSERT INTO [TBL_EmployeeEducationBG]([EBGName],[EBGDESC])VALUES('大学专科',null);
INSERT INTO [TBL_EmployeeEducationBG]([EBGName],[EBGDESC])VALUES('中等专科','通常的中专');
INSERT INTO [TBL_EmployeeEducationBG]([EBGName],[EBGDESC])VALUES('高中(职高、技高)',null);
INSERT INTO [TBL_EmployeeEducationBG]([EBGName],[EBGDESC])VALUES('初中',null);
INSERT INTO [TBL_EmployeeEducationBG]([EBGName],[EBGDESC])VALUES('小学',null);
INSERT INTO [TBL_EmployeeEducationBG]([EBGName],[EBGDESC])VALUES('其他',null);

INSERT INTO [TBL_AwardType]([ATName])VALUES('惩罚');
INSERT INTO [TBL_AwardType]([ATName])VALUES('奖励');
GO
USE [MASTER]
GO
问题补充:

需要SQL脚本的留言,博客园无法上传,提示有异常信息。应该是对某些关键字进行了过滤。

IceS的主页 IceS | 初学一级 | 园豆:197
提问于:2012-06-18 08:24
< >
分享
最佳答案
0

系统配置文件配置出错,maxBufferPoolSize和maxReceivedMessageSize没有调整到合适大小:

<wsHttpBinding>
        <binding name="wsHttpBinding_ISyncService" maxBufferPoolSize="5242880000" maxReceivedMessageSize="655360000" messageEncoding="Text" sendTimeout="00:10:00" >
          <security mode="Message">
            <message clientCredentialType="UserName" />
          </security>
        </binding>
      </wsHttpBinding>
IceS | 初学一级 |园豆:197 | 2012-07-02 17:03
其他回答(1)
0

关注!

回复内容太短(最小5个字),再写点吧!

收获园豆:50
无之无 | 园豆:5095 (大侠五级) | 2012-06-18 09:04

这得分也太容易了

支持(0) 反对(0) IceS | 园豆:197 (初学一级) | 2012-07-02 17:05

@IceS: 哈哈!估计这个兄弟。。。先给我分配了50分,在把你的选择为最佳答案的!我遇到不少这样的情况。

 

嘿嘿,今天赚翻了。改天请客!

支持(0) 反对(0) 无之无 | 园豆:5095 (大侠五级) | 2012-07-02 17:09

@IceS: 哈,没细看!是你自己解决了哦!

支持(0) 反对(0) 无之无 | 园豆:5095 (大侠五级) | 2012-07-02 17:10
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册