Beispiel #1
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);
            }
        }