예제 #1
0
        private void saveToolStripMenuItem_Click(object sender, EventArgs e)
        {
            _db = new MonetDatabase(_connectionInfo.ToString());


            try
            {
                var fileName = AskSaveFile();

                if (string.IsNullOrWhiteSpace(fileName))
                {
                    return;
                }

                var model = MonetConfigurationHelper.GetConfiguration(Path.Combine(IoHelper.CurrentRoot, MonetSettings.MonetConfigurationFile));
                var file  = Path.Combine(model.DbInstallerDir, "bin\\msqldump.exe");
                var args  =
                    $"-h \"{_db.ConnectionInfo.Host}\" -p {_db.ConnectionInfo.GetPort()} -d \"{_db.ConnectionInfo.Database}\" -u \"{_db.ConnectionInfo.UserName}\"";

                LoggerHelper.Write(LoggerOption.Info, "Database dumping started...");

                DiagnosticHelper.ShowWindowApplicationEx(file, args, fileName, null, null);

                LoggerHelper.Write(LoggerOption.Info, "Database dumped");
            }
            catch (Exception exp)
            {
                MessageBox.Show(exp.Message, @"Exception", MessageBoxButtons.OK, MessageBoxIcon.Error);

                LoggerHelper.Write(LoggerOption.Error, "Error: {0}", exp.Message);
            }
        }
예제 #2
0
        private void sqlConsoleToolStripMenuItem_Click(object sender, EventArgs e)
        {
            _db = new MonetDatabase(_connectionInfo.ToString());

            try
            {
                var model = MonetConfigurationHelper.GetConfiguration(Path.Combine(IoHelper.CurrentRoot, MonetSettings.MonetConfigurationFile));
                var file  = Path.Combine(model.DbInstallerDir, "bin\\mclient.exe");
                var args  =
                    $"-h \"{_db.ConnectionInfo.Host}\" -p {_db.ConnectionInfo.GetPort()} -d \"{_db.ConnectionInfo.Database}\" -u \"{_db.ConnectionInfo.UserName}\" -L \"{Path.Combine(model.TempDir)}\"";

                LoggerHelper.Write(LoggerOption.Info, "Starting MonetDB client session...");

                DiagnosticHelper.ShowWindowApplication(file, args);

                LoggerHelper.Write(LoggerOption.Info, "MonetDB client session closed");
            }
            catch (Exception exp)
            {
                MessageBox.Show(exp.Message, @"Exception", MessageBoxButtons.OK, MessageBoxIcon.Error);

                LoggerHelper.Write(LoggerOption.Error, "Error: {0}", exp.Message);
            }
        }
예제 #3
0
 public MonetDbtcpService()
 {
     _serverConfiguration = MonetConfigurationHelper.GetConfiguration(Path.Combine(IoHelper.CurrentRoot, MonetSettings.MonetConfigurationFile));
 }