private void log_b_ok_Click(object sender, System.EventArgs e) { // load and set profile and open database try { tdb.User prof = new tdb.User(); prof.SetLogin(this.log_e_user.Text, this.log_e_pwd.Text, this.log_e_dbn.Text, this.log_c_dbtype.Text, this.log_e_host.Text); prof.LoadProfile(this.log_e_user.Text); this.DialogResult = DialogResult.OK; } catch (System.Data.SqlClient.SqlException) { this.DialogResult = DialogResult.Cancel; MessageBox.Show("travelDB error: Could not open the database"); } Close(); }