Exemplo n.º 1
0
        //代码数据库配置
        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);
            }
        }
Exemplo n.º 2
0
        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);
            }
        }