internal OleDbErrorCollection(UnsafeNativeMethods.IErrorInfo errorInfo) { ArrayList items = new ArrayList(); UnsafeNativeMethods.IErrorRecords errorRecords = (errorInfo as UnsafeNativeMethods.IErrorRecords); if (null != errorRecords) { int recordCount = errorRecords.GetRecordCount(); for (int i = 0; i < recordCount; ++i) { OleDbError error = new OleDbError(errorRecords, i); items.Add(error); } } this.items = items; }
internal OleDbErrorCollection(UnsafeNativeMethods.IErrorInfo errorInfo) { ArrayList list = new ArrayList(); Bid.Trace("<oledb.IUnknown.QueryInterface|API|OS> IErrorRecords\n"); UnsafeNativeMethods.IErrorRecords errorRecords = errorInfo as UnsafeNativeMethods.IErrorRecords; if (errorRecords != null) { int recordCount = errorRecords.GetRecordCount(); Bid.Trace("<oledb.IErrorRecords.GetRecordCount|API|OS|RET> RecordCount=%d\n", recordCount); for (int i = 0; i < recordCount; i++) { OleDbError error = new OleDbError(errorRecords, i); list.Add(error); } } this.items = list; }
/// <include file='doc\OleDbErrorCollection.uex' path='docs/doc[@for="OleDbErrorCollection.OleDbErrorCollection"]/*' /> internal OleDbErrorCollection(UnsafeNativeMethods.IErrorRecords errorRecords) { if (null != errorRecords) { int recordCount; #if DEBUG ODB.Trace_Begin(4, "IErrorRecords", "GetRecordCount"); #endif int hr = errorRecords.GetRecordCount(out recordCount); #if DEBUG ODB.Trace_End(4, "IErrorRecords", "GetRecordCount", hr, "Count=" + recordCount); #endif if ((0 <= hr) && (0 < recordCount)) { for (int i = 0; i < recordCount; ++i) { items.Add(new OleDbError(errorRecords, i)); } } } }