public FrmLogin() { InitializeComponent(); //判断数据库链接 bool isSucc = true; try { ConnectConfigTool.setDBase(); } catch (Exception ex) { MsgBox.ShowError(ex.Message + "请检查..."); isSucc = false; } if (ConnectConfigTool.DBase == null || !isSucc) { //弹出维护数据库维护界面 using (FrmSysConnSet frm = new FrmSysConnSet()) { if (frm.ShowDialog() != DialogResult.OK) { Application.ExitThread(); Application.Exit(); return; } else { ConnectConfigTool.setDBase(); } } } }
public FrmSimula3D() { InitializeComponent(); this.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.OnMouseWheel); bool isSucc = true; try { ConnectConfigTool.setDBase(); } catch (Exception ex) { MsgBox.ShowError(ex.Message + "请检查..."); isSucc = false; } if (ConnectConfigTool.DBase == null || !isSucc) { //弹出维护数据库维护界面 using (FrmSysConnSet frm = new FrmSysConnSet()) { if (frm.ShowDialog() != DialogResult.OK) { Application.ExitThread(); Application.Exit(); return; } } } try { ConnectConfigTool.setDBase(); } catch (Exception ex) { MsgBox.ShowError(ex.Message + "请检查..."); return; } }