private void buttonChange_Click(object sender, System.EventArgs e)
        {
            ConnectToDatabaseDialog dialog = new ConnectToDatabaseDialog();

            dialog.NameRequired       = false;
            dialog.ConnectionSettings = Database.DefaultConnectionSettings;
            if (dialog.ShowDialog(this) == DialogResult.OK)
            {
                SetDatabase(dialog.ConnectionSettings, true);
            }
        }
示例#2
0
        /// <summary>
        /// Edits the connection.
        /// </summary>
        private void AddConnection()
        {
            ConnectToDatabaseDialog dialog = new ConnectToDatabaseDialog();

            if (dialog.ShowDialog(this) == DialogResult.OK)
            {
                // add...
                ConnectionSettings.SavedSettings.Add(dialog.ConnectionSettings);

                // update...
                this.RefreshConnections();
            }
        }