private void TestButton_Click(object sender, EventArgs e) { MethodResult <bool> result = Dac.TestDatabaseConnection(DatabaseFileLocationTextBox.Text); if (result.IsSuccessful) { MessageBox.Show("Database Connection Ok :-)"); } else { MessageBox.Show("Database Connection Error :-(" + Environment.NewLine + result.Exception.ToString()); } }
private void OkeyButton_Click(object sender, EventArgs e) { Dac dac = new Dac(); dac.DatabaseFileLocation = DatabaseFileLocationTextBox.Text; MethodResult <bool> result = Dac.TestDatabaseConnection(DatabaseFileLocationTextBox.Text); if (result.IsSuccessful) { dac.SaveDatabaseFileLocationToReqistry(); this.DialogResult = DialogResult.OK; } else { MessageBox.Show("Database Connection Error :-(" + Environment.NewLine + result.Exception.ToString()); } }