コード例 #1
0
        internal SqlAuthenticationMethod ConvertValueToAuthenticationType()
        {
            if (!TryGetParsetableValue(KEY.Authentication, out string value))
            {
                return(DEFAULT.Authentication);
            }

            try
            {
                return(DbConnectionStringBuilderUtil.ConvertToAuthenticationType(KEY.Authentication, value));
            }
            catch (FormatException e)
            {
                throw ADP.InvalidConnectionOptionValue(KEY.Authentication, e);
            }
            catch (OverflowException e)
            {
                throw ADP.InvalidConnectionOptionValue(KEY.Authentication, e);
            }
        }
コード例 #2
0
        internal SqlAuthenticationMethod ConvertValueToAuthenticationType()
        {
            object value = base.Parsetable[KEY.Authentication];

            string valStr = value as string;

            if (valStr == null)
            {
                return(DEFAULT.Authentication);
            }

            try {
                return(DbConnectionStringBuilderUtil.ConvertToAuthenticationType(KEY.Authentication, valStr));
            }
            catch (FormatException e) {
                throw ADP.InvalidConnectionOptionValue(KEY.Authentication, e);
            }
            catch (OverflowException e) {
                throw ADP.InvalidConnectionOptionValue(KEY.Authentication, e);
            }
        }
コード例 #3
0
 private static SqlAuthenticationMethod ConvertToAuthenticationType(string keyword, object value)
 {
     return(DbConnectionStringBuilderUtil.ConvertToAuthenticationType(keyword, value));
 }