コード例 #1
0
ファイル: MainV2.cs プロジェクト: kingboy2008/CodeGeneration
        //代码数据库配置
        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);
            }
        }
コード例 #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);
            }
        }