コード例 #1
0
        private void mnuChangeConnection_Click(object sender, System.EventArgs e)
        {
            ConnectionForm frmConnect = new ConnectionForm(connectionTitle);
            DialogResult   result     = frmConnect.ShowDialog();

            if (result == DialogResult.OK)
            {
                this.Cursor = Cursors.WaitCursor;
                try
                {
                    this.connData = frmConnect.SqlConnection;
                    this.settingsControl1.Server = this.connData.SQLServerName;
                    this.databaseList            = frmConnect.DatabaseList;
                    this.SyncForm_Load(null, EventArgs.Empty);
                    BindDatabaseListDropDown(this.databaseList);
                }
                finally
                {
                    this.Cursor = Cursors.Default;
                }
            }
        }
コード例 #2
0
        private void SyncForm_Load(object sender, System.EventArgs e)
        {
            if (this.connData == null)
            {
                ConnectionForm frmConnect = new ConnectionForm(connectionTitle);
                DialogResult   result     = frmConnect.ShowDialog();
                if (result == DialogResult.OK)
                {
                    this.connData = frmConnect.SqlConnection;
                }
                else
                {
                    MessageBox.Show("Sql Schema Scripting can not continue without a valid Sql Connection", "Unable to Load", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                    this.Close();
                }
            }

            this.databaseList = SqlSync.DbInformation.InfoHelper.GetDatabaseList(this.connData);
            BindDatabaseListDropDown(this.databaseList);
            BindScriptTypeDropDown();
            this.settingsControl1.Server = this.connData.SQLServerName;
        }