Exemplo n.º 1
0
        private void GetConnectionInfoByProfile(bool isSource)
        {
            DatabaseType   dbType         = this.GetDatabaseType(isSource ? this.cboSourceDB.Text : this.cboTargetDB.Text);
            string         profileName    = ((isSource ? this.cboSourceProfile : this.cboTargetProfile).SelectedItem as ConnectionInfoProfile)?.Name;
            ConnectionInfo connectionInfo = ConnectionInfoProfileManager.GetConnectionInfo(dbType, profileName);

            if (connectionInfo != null)
            {
                if (isSource)
                {
                    this.sourceDbConnectionInfo = connectionInfo;
                }
                else
                {
                    this.targetDbConnectionInfo = connectionInfo;
                }
            }

            if (!isSource)
            {
                if (dbType == DatabaseType.SqlServer)
                {
                    if (string.IsNullOrEmpty(this.txtTargetDbOwner.Text.Trim()))
                    {
                        this.txtTargetDbOwner.Text = "dbo";
                    }
                }
                else
                {
                    this.txtTargetDbOwner.Text = "";
                }
            }
        }
Exemplo n.º 2
0
        private void LoadProfile()
        {
            ConnectionInfo connectionInfo = ConnectionInfoProfileManager.GetConnectionInfo(this.DatabaseType, this.ProflieName);

            this.txtServerName.Text     = connectionInfo.Server;
            this.txtPort.Text           = connectionInfo.Port;
            this.cboAuthentication.Text = connectionInfo.IntegratedSecurity ? AuthenticationType.Windows.ToString() : AuthenticationType.Password.ToString();
            this.txtUserId.Text         = connectionInfo.UserId;
            this.txtPassword.Text       = connectionInfo.Password;
            this.cboDatabase.Text       = connectionInfo.Database;

            if (connectionInfo.IntegratedSecurity)
            {
                this.cboAuthentication.Text = AuthenticationType.Windows.ToString();
            }
            else
            {
                if (!string.IsNullOrEmpty(connectionInfo.Password))
                {
                    this.chkRememberPassword.Checked = true;
                }
            }
        }