コード例 #1
0
ファイル: OleDbException.cs プロジェクト: mikem8361/runtime
 public override object?ConvertTo(ITypeDescriptorContext?context, CultureInfo?culture, object?value, Type destinationType)
 {
     if (destinationType == null)
     {
         throw ADP.ArgumentNull("destinationType");
     }
     if ((destinationType == typeof(string)) && (value != null) && (value is int))
     {
         return(ODB.ELookup((OleDbHResult)value));
     }
     return(base.ConvertTo(context, culture, value, destinationType));
 }
コード例 #2
0
        private void FillCloseError(COMException e, Exception f)
        {
#if DEBUG
            if (AdapterSwitches.DataError.TraceError)
            {
                Debug.WriteLine(e.ToString() + " " + ODB.ELookup(e.ErrorCode));
            }
#endif
            if (ODB.ADODB_AlreadyClosedError != e.ErrorCode)
            {
                throw f;
            }
        }
コード例 #3
0
ファイル: OleDb_Util.cs プロジェクト: hongyeli620/runtime
        internal static OleDbHResult GetErrorDescription(UnsafeNativeMethods.IErrorInfo errorInfo, OleDbHResult hresult, out string message)
        {
            OleDbHResult hr = errorInfo.GetDescription(out message);

            if (((int)hr < 0) && ADP.IsEmpty(message))
            {
                message = FailedGetDescription(hr) + Environment.NewLine + ODB.ELookup(hresult);
            }
            if (ADP.IsEmpty(message))
            {
                message = ODB.ELookup(hresult);
            }
            return(hr);
        }
コード例 #4
0
ファイル: OleDb_Util.cs プロジェクト: hongyeli620/runtime
        internal static OleDbException NoErrorInformation(string provider, OleDbHResult hr, Exception inner)
        {
            OleDbException e;

            if (!ADP.IsEmpty(provider))
            {
                e = new OleDbException(SR.Format(SR.OleDb_NoErrorInformation2, provider, ODB.ELookup(hr)), hr, inner);
            }
            else
            {
                e = new OleDbException(SR.Format(SR.OleDb_NoErrorInformation, ODB.ELookup(hr)), hr, inner);
            }
            ADP.TraceExceptionAsReturnValue(e);
            return(e);
        }
コード例 #5
0
        private void FillNextResultError(COMException e, Exception f)
        {
#if DEBUG
            if (AdapterSwitches.DataError.TraceError)
            {
                Debug.WriteLine(e.ToString() + " " + ODB.ELookup(e.ErrorCode));
            }
#endif
            // i.e. ADODB.Recordset opened with adCmdTableDirect
            // Current provider does not support returning multiple recordsets from a single execution.
            if (ODB.ADODB_NextResultError != e.ErrorCode)
            {
                throw f;
            }
        }
コード例 #6
0
        static internal OleDbHResult GetErrorDescription(UnsafeNativeMethods.IErrorInfo errorInfo, OleDbHResult hresult, out string message)
        {
            Bid.Trace("<oledb.IErrorInfo.GetDescription|API|OS>\n");
            OleDbHResult hr = errorInfo.GetDescription(out message);

            Bid.Trace("<oledb.IErrorInfo.GetDescription|API|OS|RET> %08X{HRESULT}, Message='%ls'\n", hr, message);
            if (((int)hr < 0) && ADP.IsEmpty(message))
            {
                message = FailedGetDescription(hr) + Environment.NewLine + ODB.ELookup(hresult);
            }
            if (ADP.IsEmpty(message))
            {
                message = ODB.ELookup(hresult);
            }
            return(hr);
        }
コード例 #7
0
ファイル: OleDb_Util.cs プロジェクト: hongyeli620/runtime
 internal static string FailedGetSource(OleDbHResult errorcode)
 {
     return(SR.Format(SR.OleDb_FailedGetSource, ODB.ELookup(errorcode)));
 }
コード例 #8
0
ファイル: OleDb_Util.cs プロジェクト: hongyeli620/runtime
 internal static string FailedGetDescription(OleDbHResult errorcode)
 {
     return(SR.Format(SR.OleDb_FailedGetDescription, ODB.ELookup(errorcode)));
 }
コード例 #9
0
ファイル: OleDb_Util.cs プロジェクト: hongyeli620/runtime
 internal static string NoErrorMessage(OleDbHResult errorcode)
 {
     return(SR.Format(SR.OleDb_NoErrorMessage, ODB.ELookup(errorcode)));
 }
コード例 #10
0
 static internal string FailedGetSource(OleDbHResult errorcode)
 {
     return(Res.GetString(Res.OleDb_FailedGetSource, ODB.ELookup(errorcode)));
 }
コード例 #11
0
 static internal string FailedGetDescription(OleDbHResult errorcode)
 {
     return(Res.GetString(Res.OleDb_FailedGetDescription, ODB.ELookup(errorcode)));
 }
コード例 #12
0
 static internal string NoErrorMessage(OleDbHResult errorcode)
 {
     return(Res.GetString(Res.OleDb_NoErrorMessage, ODB.ELookup(errorcode)));
 }