Beispiel #1
0
        private long DoBulkInsert(string tableName, DataTable dataTable)
        {
            IBulkOperations bulkOps = BulkOperationsFactory.Create(_connection);

            bulkOps.Connection = _connection;
            bulkOps.TableName  = tableName;
            ValidateDatabaseTableStructure(tableName, dataTable);
            var countStart = CountRowsInTable(tableName);

            bulkOps.WriteToServer(dataTable);
            var countEnd = CountRowsInTable(tableName);

            return(countEnd - countStart);
        }