diff --git a/src/System.Data.OleDb/src/OleDbConnection.cs b/src/System.Data.OleDb/src/OleDbConnection.cs index d337db4d4fcc..3a9a17c7e897 100644 --- a/src/System.Data.OleDb/src/OleDbConnection.cs +++ b/src/System.Data.OleDb/src/OleDbConnection.cs @@ -515,12 +515,6 @@ internal void OnInfoMessage(UnsafeNativeMethods.IErrorInfo errorInfo, OleDbHResu ADP.TraceExceptionWithoutRethrow(e); } } -#if DEBUG - else - { - OleDbException exception = OleDbException.CreateException(errorInfo, errorCode, null); - } -#endif } public override void Open() diff --git a/src/System.Data.OleDb/src/OleDbConnectionInternal.cs b/src/System.Data.OleDb/src/OleDbConnectionInternal.cs index 6cabd022ebb9..ebd13dcea280 100644 --- a/src/System.Data.OleDb/src/OleDbConnectionInternal.cs +++ b/src/System.Data.OleDb/src/OleDbConnectionInternal.cs @@ -321,7 +321,6 @@ public override void Dispose() public override void EnlistTransaction(SysTx.Transaction transaction) { - OleDbConnection outerConnection = Connection; if (null != LocalTransaction) { throw ADP.LocalTransactionPresent(); @@ -821,8 +820,6 @@ internal OleDbTransaction ValidateTransaction(OleDbTransaction transaction, stri internal Dictionary GetPropertyInfo(Guid[] propertySets) { - bool isopen = HasSession; - OleDbConnectionString constr = ConnectionString; Dictionary properties = null; if (null == propertySets) diff --git a/src/System.Data.OleDb/src/OleDbDataAdapter.cs b/src/System.Data.OleDb/src/OleDbDataAdapter.cs index cdd5c63432e4..e50b7b50b44f 100644 --- a/src/System.Data.OleDb/src/OleDbDataAdapter.cs +++ b/src/System.Data.OleDb/src/OleDbDataAdapter.cs @@ -262,10 +262,6 @@ record = (adodb as UnsafeNativeMethods.ADORecordConstruction); UnsafeNativeMethods.GetErrorInfo(0, out errorInfo); string message = string.Empty; - if (null != errorInfo) - { - OleDbHResult hresult = ODB.GetErrorDescription(errorInfo, hr, out message); - } throw new COMException(message, (int)hr); } break; @@ -436,10 +432,6 @@ private void FillClose(bool isrecordset, object value) UnsafeNativeMethods.IErrorInfo errorInfo = null; UnsafeNativeMethods.GetErrorInfo(0, out errorInfo); string message = string.Empty; - if (null != errorInfo) - { - OleDbHResult hresult = ODB.GetErrorDescription(errorInfo, hr, out message); - } throw new COMException(message, (int)hr); } } diff --git a/src/System.Data.OleDb/src/OleDbDataReader.cs b/src/System.Data.OleDb/src/OleDbDataReader.cs index 1359e81b4549..5ee968c3c07a 100644 --- a/src/System.Data.OleDb/src/OleDbDataReader.cs +++ b/src/System.Data.OleDb/src/OleDbDataReader.cs @@ -1166,7 +1166,7 @@ public override int GetValues(object[] values) { throw ADP.ArgumentNull("values"); } - MetaData info = DoValueCheck(0); + DoValueCheck(0); int count = Math.Min(values.Length, _visibleFieldCount); for (int i = 0; (i < _metadata.Length) && (i < count); ++i) { @@ -2163,7 +2163,6 @@ private void AppendSchemaUniqueIndexAsKey(Hashtable baseColumnNames, object[] re { bool isPKey = (!dataRow.IsNull(pkeyColumn, DataRowVersion.Default) && (bool)dataRow[pkeyColumn, DataRowVersion.Default]); bool isUniq = (!dataRow.IsNull(uniqCOlumn, DataRowVersion.Default) && (bool)dataRow[uniqCOlumn, DataRowVersion.Default]); - bool nullsVal = (null != nulls) && (dataRow.IsNull(nulls, DataRowVersion.Default) || (ODB.DBPROPVAL_IN_ALLOWNULL == Convert.ToInt32(dataRow[nulls, DataRowVersion.Default], CultureInfo.InvariantCulture))); if (isPKey || isUniq) { diff --git a/src/System.Data.OleDb/src/OleDbTransaction.cs b/src/System.Data.OleDb/src/OleDbTransaction.cs index 2c05339f9a88..0db6714d5477 100644 --- a/src/System.Data.OleDb/src/OleDbTransaction.cs +++ b/src/System.Data.OleDb/src/OleDbTransaction.cs @@ -108,7 +108,7 @@ protected override bool ReleaseHandle() { if (_mustComplete && (IntPtr.Zero != base.handle)) { - OleDbHResult hr = (OleDbHResult)NativeOledbWrapper.ITransactionAbort(base.handle); + NativeOledbWrapper.ITransactionAbort(base.handle); _mustComplete = false; } return base.ReleaseHandle(); diff --git a/src/System.Data.OleDb/src/RowBinding.cs b/src/System.Data.OleDb/src/RowBinding.cs index 6b0f7629aa4f..9bd1c700019d 100644 --- a/src/System.Data.OleDb/src/RowBinding.cs +++ b/src/System.Data.OleDb/src/RowBinding.cs @@ -478,8 +478,7 @@ private static void FreeChapter(IntPtr buffer, int valueOffset, object iaccessor IntPtr chapter = SafeNativeMethods.InterlockedExchangePointer(ADP.IntPtrOffset(buffer, valueOffset), ADP.PtrZero); if (ODB.DB_NULL_HCHAPTER != chapter) { - int refCount; - OleDbHResult hr = chapteredRowset.ReleaseChapter(chapter, out refCount); + chapteredRowset.ReleaseChapter(chapter, out _); } } diff --git a/src/System.Data.OleDb/src/SafeHandles.cs b/src/System.Data.OleDb/src/SafeHandles.cs index cf4872210f9f..727d3d4ada8c 100644 --- a/src/System.Data.OleDb/src/SafeHandles.cs +++ b/src/System.Data.OleDb/src/SafeHandles.cs @@ -160,7 +160,7 @@ protected override bool ReleaseHandle() if ((IntPtr.Zero != base.handle) && (IntPtr.Zero != chapter)) { - OleDbHResult hr = (OleDbHResult)NativeOledbWrapper.IChapteredRowsetReleaseChapter(base.handle, chapter); + NativeOledbWrapper.IChapteredRowsetReleaseChapter(base.handle, chapter); } return base.ReleaseHandle(); }