private bool DbConnectionOk(string dbDriver, string connectionString, bool silent) { var testConnectionForm = new TestConnectionForm(dbDriver, connectionString, silent); testConnectionForm.ShowDialog(this); return(TestConnectionForm.State != ConnectionTestState.Error); }
private void Setup(DefaultSettings settings) { string error = string.Empty; try { myMeta = new dbRoot(); this.Text = "MyMeta Browser (" + settings.DbDriver + ")"; if (settings.DbDriver.ToUpper() != "NONE") { #if !DEBUG TestConnectionForm tcf = new TestConnectionForm(settings.DbDriver, settings.ConnectionString, true); if (isFirstRun) { tcf.StartPosition = FormStartPosition.CenterScreen; isFirstRun = false; } tcf.ShowDialog(this.MdiParent); if (TestConnectionForm.State == ConnectionTestState.Error) { if (TestConnectionForm.LastErrorMsg != null) { error = TestConnectionForm.LastErrorMsg; } else { error = "Connection Error..."; } } tcf = null; #endif } if (error == string.Empty) { myMeta.Connect(settings.DbDriver, settings.ConnectionString); myMeta.LanguageMappingFileName = settings.LanguageMappingFile; myMeta.Language = settings.Language; myMeta.DbTargetMappingFileName = settings.DbTargetMappingFile; myMeta.DbTarget = settings.DbTarget; myMeta.UserMetaDataFileName = settings.UserMetaDataFileName; myMeta.DomainOverride = settings.DomainOverride; myMeta.ShowSystemData = chkSystem.Checked; } } catch (Exception ex) { error = ex.Message; } this.InitializeTree(myMeta, error); }
private bool TestConnection(bool silent, string driver, string connstr) { TestConnectionForm tcf = new TestConnectionForm(driver, connstr, silent);//silent); tcf.ShowDialog(this); if (TestConnectionForm.State == ConnectionTestState.Error) { return(false); } else if (!silent) { //? } tcf = null; return(true); }
private bool TestConnection(bool silent, string driver, string connstr) { TestConnectionForm tcf = new TestConnectionForm(driver, connstr, silent);//silent); tcf.ShowDialog(this); if (TestConnectionForm.State == ConnectionTestState.Error) { return false; } else if (!silent) { //? } tcf = null; return true; }
private void Setup(DefaultSettings settings) { string error = string.Empty; try { myMeta = new dbRoot(); this.Text = "MyMeta Browser (" + settings.DbDriver + ")"; if (settings.DbDriver.ToUpper() != "NONE") { #if !DEBUG TestConnectionForm tcf = new TestConnectionForm(settings.DbDriver, settings.ConnectionString, true); if (isFirstRun) { tcf.StartPosition = FormStartPosition.CenterScreen; isFirstRun = false; } tcf.ShowDialog(this.MdiParent); if (TestConnectionForm.State == ConnectionTestState.Error) { if (TestConnectionForm.LastErrorMsg != null) error = TestConnectionForm.LastErrorMsg; else error = "Connection Error..."; } tcf = null; #endif } if (error == string.Empty) { myMeta.Connect(settings.DbDriver, settings.ConnectionString); myMeta.LanguageMappingFileName = settings.LanguageMappingFile; myMeta.Language = settings.Language; myMeta.DbTargetMappingFileName = settings.DbTargetMappingFile; myMeta.DbTarget = settings.DbTarget; myMeta.UserMetaDataFileName = settings.UserMetaDataFileName; myMeta.DomainOverride = settings.DomainOverride; myMeta.ShowSystemData = chkSystem.Checked; } } catch(Exception ex) { error = ex.Message; } this.InitializeTree(myMeta, error); }
private bool TestConnection(bool silent, string driver, string connstr) { TestConnectionForm tcf = new TestConnectionForm(driver, connstr, silent);//silent); tcf.ShowDialog(this); if (TestConnectionForm.State == ConnectionTestState.Error) { //MessageBox.Show("Invalid ConnectionString", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return false; } else if (!silent) { //MessageBox.Show("Test Connection Successful ", "", MessageBoxButtons.OK, MessageBoxIcon.Information); } tcf = null; return true; }