private void SysDefineView_Load(object sender, EventArgs e) { this.toolStripComboBox1.Items.AddRange(new string[] { "线体控制数据库", "MES数据库" }); this.toolStripComboBox1.SelectedIndex = 0; mesDA = new MesDA(); string reStr = ""; if (!mesDA.ConnDB(ref reStr)) { MessageBox.Show(reStr, "MES数据库连接失败"); } }
private void MesDBConn(string connString) { try { AddLog(connString); mesDA.MesdbConnstr = connString; // conn.ConnectionString = connString; // conn.Open(); string reStr = ""; mesDA.ConnDB(ref reStr); AddLog(reStr); } catch (Exception ex) { AddLog(ex.ToString()); } }