예제 #1
0
        protected virtual SqlBulkCopy CreateSqlBulkCopyHelper(DataTable dataTable, SqlBulkHelpersTableDefinition tableDefinition, SqlTransaction transaction)
        {
            var factory     = new SqlBulkCopyFactory(); //Load with all Defaults from our Factory.
            var sqlBulkCopy = factory.CreateSqlBulkCopy(dataTable, tableDefinition, transaction);

            return(sqlBulkCopy);
        }
        protected virtual SqlBulkCopy CreateSqlBulkCopyHelper(
            DataTable dataTable,
            SqlBulkHelpersTableDefinition tableDefinition,
            SqlTransaction transaction,
            int timeoutSeconds
            )
        {
            //Initialize the BulkCopy Factory class with parameters...
            var factory = new SqlBulkCopyFactory()
            {
                BulkCopyTimeoutSeconds = timeoutSeconds
            };

            var sqlBulkCopy = factory.CreateSqlBulkCopy(dataTable, tableDefinition, transaction);

            return(sqlBulkCopy);
        }