Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

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


View products that this article applies to.

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.

↑ Back to the top


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

↑ Back to the top


Keywords: KB819759, kbbug, kbnofix

↑ Back to the top

Article Info
Article ID : 819759
Revision : 3
Created on : 2/22/2007
Published on : 2/22/2007
Exists online : False
Views : 397