Пример #1
0
        /// <summary>
        /// Write to server async
        /// </summary>
        /// <param name="table"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public async Task WriteToServerAsync(DataTable table, CancellationToken cancellationToken = default)
        {
            var bulkLoader = MySqlBulkCopyHelper.GetBulkLoader(_connection, table, DestinationTableName, BulkCopyTimeout, SecureFilePriv);

            UpdateCurrentFilePath(bulkLoader.FileName);
            UpdateColumnInfo(bulkLoader, table);

            await bulkLoader.LoadAsync(cancellationToken);
        }
Пример #2
0
        /// <summary>
        /// Write to server
        /// </summary>
        /// <param name="table"></param>
        public void WriteToServer(DataTable table)
        {
            var bulkLoader = MySqlBulkCopyHelper.GetBulkLoader(_connection, table, DestinationTableName, BulkCopyTimeout, SecureFilePriv);

            UpdateCurrentFilePath(bulkLoader.FileName);
            UpdateColumnInfo(bulkLoader, table);

            bulkLoader.Load();
        }