Microsoft KB Archive/819759

= BUG: Parameters That Are Larger Than 4095 Cause System.InvalidOperationException =

Article ID: 819759

Article Last Modified on 2/22/2007

-

APPLIES TO


 * Microsoft Host Integration Server 2000 Standard Edition
 * Microsoft Host Integration Server 2000 Service Pack 1

-



SYMPTOMS
When you use the OLE DB Provider for DB2 (DB2OLEDB) from a .NET Framework application with the Managed Provider for OLEDB, if you pass a parameter larger than 4095 (that is, 4096 or higher), you receive a System.InvalidOperationException error.

This exception contains:
 * An inner exception of type System.Data.OleDb.OleDbException

with an HRESULT of 0x80040E21 (-2147217887)
 * The following error message:

Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.



CAUSE
In the .NET Framework, if the parameter is larger than 4095, when the Managed Provider for OLEDB passes the DBPARAMS structure to DB2OLEDB, the parameter is passed as DBTYPE_BYREF.

For example, if the parameter is type OleDbType.Char, the Managed Provider for OLEDB passes this as type 0x4082 (DBTYPE_WSTR && DBTYPE_BYREF), instead of as 0x82 (DBTYPE_WSTR). The OLE DB Provider for DB2 does not support DBTYPE_BYREF. Therefore, data conversion does not succeed and you receive the error

Keywords: kbnofix kbbug KB819759

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.