示例#1
0
        void Export_InitializeVariables()
        {
            if (Command == null)
            {
                throw new Exception("MySqlCommand is not initialized. Object not set to an instance of an object.");
            }

            if (Command.Connection == null)
            {
                throw new Exception("MySqlCommand.Connection is not initialized. Object not set to an instance of an object.");
            }

            if (Command.Connection.State != System.Data.ConnectionState.Open)
            {
                throw new Exception("MySqlCommand.Connection is not opened.");
            }

            if (ExportInfo.BlobExportMode == BlobDataExportMode.BinaryChar &&
                !ExportInfo.BlobExportModeForBinaryStringAllow)
            {
                throw new Exception("[ExportInfo.BlobExportMode = BlobDataExportMode.BinaryString] is still under development. Please join the discussion at https://github.com/MySqlBackupNET/MySqlBackup.Net/issues (Title: Help requires. Unable to export BLOB in Char Format)");
            }

            timeStart = DateTime.Now;

            stopProcess           = false;
            processCompletionType = ProcessEndType.UnknownStatus;
            currentProcess        = ProcessType.Export;
            _lastError            = null;
            timerReport.Interval  = ExportInfo.IntervalForProgressReport;
            //GetSHA512HashFromPassword(ExportInfo.EncryptionPassword);

            _database.GetDatabaseInfo(Command, ExportInfo.GetTotalRowsMode);
            _server.GetServerInfo(Command);
            _currentTableName        = string.Empty;
            _totalRowsInCurrentTable = 0L;
            _totalRowsInAllTables    = Export_GetTablesToBeExported()
                                       .Sum(pair => _database.Tables[pair.Key].TotalRows);
            _currentRowIndexInCurrentTable = 0;
            _currentRowIndexInAllTable     = 0;
            _totalTables       = 0;
            _currentTableIndex = 0;
        }
示例#2
0
        void Export_InitializeVariables()
        {
            if (Command == null)
            {
                throw new Exception("MySqlCommand is not initialized. Object not set to an instance of an object.");
            }

            if (Command.Connection == null)
            {
                throw new Exception("MySqlCommand.Connection is not initialized. Object not set to an instance of an object.");
            }

            if (Command.Connection.State != System.Data.ConnectionState.Open)
            {
                throw new Exception("MySqlCommand.Connection is not opened.");
            }

            timeStart = DateTime.Now;

            stopProcess           = false;
            processCompletionType = ProcessEndType.UnknownStatus;
            currentProcess        = ProcessType.Export;
            _lastError            = null;
            timerReport.Interval  = ExportInfo.IntervalForProgressReport;
            GetSHA512HashFromPassword(ExportInfo.EncryptionPassword);

            _database.GetDatabaseInfo(Command, ExportInfo.GetTotalRowsBeforeExport);
            _server.GetServerInfo(Command);
            _currentTableName              = "";
            _totalRowsInCurrentTable       = 0;
            _totalRowsInAllTables          = _database.TotalRows;
            _currentRowIndexInCurrentTable = 0;
            _currentRowIndexInAllTable     = 0;
            _totalTables       = 0;
            _currentTableIndex = 0;
        }