Example #1
0
        /// <summary>
        /// Read Credential for given instance Info. Tries the test credential id and if no password found
        /// will try the MSSQL credential id
        /// </summary>
        public Credential ReadCredential(InstanceInfo connectionProfile)
        {
            var credentialParams = new Credential();

            credentialParams.CredentialId = FormatCredentialIdForTest(connectionProfile);
            Credential credential = credentialService.ReadCredential(credentialParams);

            if (credential == null || string.IsNullOrEmpty(credential.Password))
            {
                credentialParams.CredentialId = FormatCredentialIdForMsSql(connectionProfile);
                credential = credentialService.ReadCredential(credentialParams);
            }

            return(credential);
        }