* emove unused locals in System.Data.OleDband keep some logic using discard. Partially fix issue dotnet/corefx#39962
* Update src/System.Data.OleDb/src/OleDbDataReader.cs
update as suggested (OleDbDataReader)
Co-Authored-By: Stephen Toub <stoub@microsoft.com>
* Update src/System.Data.OleDb/src/OleDbTransaction.cs
Done update as suggested
Co-Authored-By: Stephen Toub <stoub@microsoft.com>
* Update src/System.Data.OleDb/src/RowBinding.cs
Done update as suggested (RowDataBinding)
Co-Authored-By: Stephen Toub <stoub@microsoft.com>
* Update src/System.Data.OleDb/src/RowBinding.cs
Done as suggested
Co-Authored-By: Stephen Toub <stoub@microsoft.com>
* Update src/System.Data.OleDb/src/SafeHandles.cs
Done updating as suggested (SafeHandles)
Co-Authored-By: Stephen Toub <stoub@microsoft.com>
Commit migrated from https://github.com/dotnet/corefx/commit/
eceea8b4284ca42d8bd0134414b43c835bd80e4c
ADP.TraceExceptionWithoutRethrow(e);
}
}
-#if DEBUG
- else
- {
- OleDbException exception = OleDbException.CreateException(errorInfo, errorCode, null);
- }
-#endif
}
public override void Open()
public override void EnlistTransaction(SysTx.Transaction transaction)
{
- OleDbConnection outerConnection = Connection;
if (null != LocalTransaction)
{
throw ADP.LocalTransactionPresent();
internal Dictionary<string, OleDbPropertyInfo> GetPropertyInfo(Guid[] propertySets)
{
- bool isopen = HasSession;
- OleDbConnectionString constr = ConnectionString;
Dictionary<string, OleDbPropertyInfo> properties = null;
if (null == propertySets)
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;
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);
}
}
{
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)
{
{
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)
{
{
if (_mustComplete && (IntPtr.Zero != base.handle))
{
- OleDbHResult hr = (OleDbHResult)NativeOledbWrapper.ITransactionAbort(base.handle);
+ NativeOledbWrapper.ITransactionAbort(base.handle);
_mustComplete = false;
}
return base.ReleaseHandle();
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 _);
}
}
if ((IntPtr.Zero != base.handle) && (IntPtr.Zero != chapter))
{
- OleDbHResult hr = (OleDbHResult)NativeOledbWrapper.IChapteredRowsetReleaseChapter(base.handle, chapter);
+ NativeOledbWrapper.IChapteredRowsetReleaseChapter(base.handle, chapter);
}
return base.ReleaseHandle();
}