//代码数据库配置 private void buttonItem6_Click(object sender, EventArgs e) { FrmAddConnection connection = new FrmAddConnection(); connection.ShowDialog(); if (!string.IsNullOrEmpty(connection.ConnectionString)) { new XmlHelper(Application.StartupPath).AddConnection(connection.ConnectionName, connection.ConnectionString, connection.SelectedDataBase); } }
private void butAddConnection_Click(object sender, EventArgs e) { FrmAddConnection connection = new FrmAddConnection(); connection.ShowDialog(); if (!string.IsNullOrEmpty(connection.ConnectionString)) { new XmlHelper(Application.StartupPath).AddConnection(connection.ConnectionName, connection.ConnectionString, connection.SelectedDataBase); this.BindConnection(); this.cboxConnectionNameColl.SelectedIndex = this.cboxConnectionNameColl.Items.Count - 1; this.butTest_Click(null, null); } }