示例#1
0
        public void Initialize(DataTable schemaTable, TableInitializationOptions options)
        {
            if ((options & TableInitializationOptions.Drop) != 0)
            {
                Drop();
            }

            LoadColumnsFromSchemaTable(schemaTable);

            if ((options & TableInitializationOptions.Append) != 0)
            {
                if (!VerifyColumns(true))
                {
                    throw new SchemaException("Table is to be appended but schemas do not match.");  // *** TODO
                }
            }
            else if ((options & TableInitializationOptions.Create) != 0)
            {
                Create();
            }
            else
            {
                // *** TODO: implement other options
                throw new NotImplementedException();
            }

            if ((options & TableInitializationOptions.Clear) != 0)
            {
                Truncate();
            }
        }
示例#2
0
 private void CopyMembers(DestinationTable old)
 {
     this.dataset      = old.dataset;
     this.databaseName = old.databaseName;
     this.schemaName   = old.schemaName;
     this.tableName    = old.tableName;
     this.options      = old.options;
 }
示例#3
0
 private void InitializeMembers()
 {
     this.dataset      = null;
     this.databaseName = null;
     this.schemaName   = null;
     this.tableName    = null;
     this.options      = TableInitializationOptions.Create;
 }
示例#4
0
        public DestinationTable(SqlServerDataset dataset, string databaseName, string schemaName, string tableName, TableInitializationOptions options)
        {
            InitializeMembers();

            this.dataset = dataset;
            this.databaseName = databaseName;
            this.schemaName = schemaName;
            this.tableName = tableName;
            this.options = options;
        }
示例#5
0
        public DestinationTable(SqlServerDataset dataset, string databaseName, string schemaName, string tableName, TableInitializationOptions options)
        {
            InitializeMembers();

            this.dataset      = dataset;
            this.databaseName = databaseName;
            this.schemaName   = schemaName;
            this.tableName    = tableName;
            this.options      = options;
        }
示例#6
0
        public void Initialize(DataTable schemaTable, TableInitializationOptions options)
        {
            if ((options & TableInitializationOptions.Drop) != 0)
            {
                Drop();
            }

            LoadColumnsFromSchemaTable(schemaTable);

            if ((options & TableInitializationOptions.Append) != 0)
            {
                if (!VerifyColumns(true))
                {
                    throw new SchemaException("Table is to be appended but schemas do not match.");  // *** TODO
                }
            }
            else if ((options & TableInitializationOptions.Create) != 0)
            {
                Create();
            }
            else
            {
                // *** TODO: implement other options
                throw new NotImplementedException();
            }

            if ((options & TableInitializationOptions.Clear) != 0)
            {
                Truncate();
            }
        }
示例#7
0
 private void InitializeMembers()
 {
     this.dataset = null;
     this.databaseName = null;
     this.schemaName = null;
     this.tableName = null;
     this.options = TableInitializationOptions.Create;
 }
示例#8
0
 private void CopyMembers(DestinationTable old)
 {
     this.dataset = old.dataset;
     this.databaseName = old.databaseName;
     this.schemaName = old.schemaName;
     this.tableName = old.tableName;
     this.options = old.options;
 }