Пример #1
0
        private SNIErrorDetails GetSniErrorDetails()
        {
            SNIErrorDetails details = new SNIErrorDetails();

            if (TdsParserStateObjectFactory.UseManagedSNI)
            {
                SNIError sniError = SNIProxy.GetInstance().GetLastError();
                details.sniErrorNumber = sniError.sniError;
                details.errorMessage   = sniError.errorMessage;
                details.nativeError    = sniError.nativeError;
                details.provider       = (int)sniError.provider;
                details.lineNumber     = sniError.lineNumber;
                details.function       = sniError.function;
                details.exception      = sniError.exception;
            }
            else
            {
                SNINativeMethodWrapper.SNIGetLastError(out SNINativeMethodWrapper.SNI_Error sniError);
                details.sniErrorNumber = sniError.sniError;
                details.errorMessage   = sniError.errorMessage;
                details.nativeError    = sniError.nativeError;
                details.provider       = (int)sniError.provider;
                details.lineNumber     = sniError.lineNumber;
                details.function       = sniError.function;
            }
            return(details);
        }
Пример #2
0
        private SNIErrorDetails GetSniErrorDetails()
        {
            SNIErrorDetails details;
            SNIError        sniError = SNIProxy.GetInstance().GetLastError();

            details.sniErrorNumber = sniError.sniError;
            details.errorMessage   = sniError.errorMessage;
            details.nativeError    = sniError.nativeError;
            details.provider       = (int)sniError.provider;
            details.lineNumber     = sniError.lineNumber;
            details.function       = sniError.function;
            details.exception      = sniError.exception;

            return(details);
        }