Example #1
0
        private void btnRestaurar_Click(object sender, EventArgs e)
        {
            CLS.Utilities objConx          = new CLS.Utilities();
            string        ConnectionString = objConx.GetConnectionString();

            ConnectionString += ";convertzerodatetime=true;";

            OpenFileDialog openFileDialog1 = new OpenFileDialog();

            openFileDialog1.Filter = "SQL Script|*.sql";
            openFileDialog1.Title  = "Open Script File";
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                dumpFile = openFileDialog1.FileName;

                // Reset variables
                curBytes   = 0;
                totalBytes = 0;
                cancel     = false;
                // Initialize MySqlConnection and MySqlCommand components
                conn           = new MySqlConnection(ConnectionString);
                cmd            = new MySqlCommand();
                cmd.Connection = conn;
                conn.Open();
                // Start the Timer here
                timer1.Start();
                mb.ImportInfo.IntervalForProgressReport = (int)nmImInterval.Value;
                mb.Command = cmd;
                bwImport.RunWorkerAsync();
            }
        }
Example #2
0
        private void btnBackup_Click(object sender, EventArgs e)
        {
            //Sin Usarse porque estan por separados los módulos de respaldo y restauración.
            DateTime       Hoy             = DateTime.Now; //antes DateTime Hoy = DateTime.today;
            SaveFileDialog saveFileDialog1 = new SaveFileDialog();

            saveFileDialog1.Filter = "SQL Script|*.sql";
            saveFileDialog1.Title  = "Save as Script File";
            DBM.CLS.Utilities config = new CLS.Utilities();

            saveFileDialog1.FileName = config.GetMySQL_DatabaseName() + " Date " + Hoy.ToString("dd-MM-yyyy HH.mm") + ".sql";

            CLS.Utilities objConx          = new CLS.Utilities();
            string        ConnectionString = objConx.GetConnectionString();

            ConnectionString += ";charset=utf8;convertzerodatetime=true;";
            if (saveFileDialog1.ShowDialog() == DialogResult.OK)
            {
                dumpFile = saveFileDialog1.FileName;
                // Reset variables
                curTable    = 0;
                totalTables = 0;
                cancel      = false;
                // Initialize MySqlConnection and MySqlCommand components
                conn           = new MySqlConnection(ConnectionString);
                cmd            = new MySqlCommand();
                cmd.Connection = conn;
                conn.Open();
                // Start the Timer here
                timer2.Start();
                mb.ExportInfo.IntervalForProgressReport = (int)nmImInterval.Value;
                mb.Command = cmd;
                bwExport.RunWorkerAsync();
            }
        }
Example #3
0
 private void btnObtieneCNX_Click(object sender, EventArgs e)
 {
     CLS.Utilities objCnx = new CLS.Utilities();
     txtCadenaConexion.Text = objCnx.GetConnectionString();
 }