Skip to Main Content

OracleCommandBuilder BindByName=true raises Exception

Christoph WagnerAug 25 2020 — edited Aug 26 2020

We are currently in the process of replaceing the deprecated MS DataProvider with the current Oracle.Managed.DataAccess components.

In order to provide seemless integration we followed the recommended BindByName=true setting for OracleCommands, as this was the default for the MS Provider.
We use this as an Application wide setting in our App.config file. Basically this works, but we are now facing a Problem with the OracleCommandBuilder in combination with DataAdapters.
Dureing comman creation the Builder seems to create the commands with the respected App.config setting (BindByName=true) but unfortunatly create commands that rely on the BindByPosition (BindByName=false) setting.
This leads to an exception when we create and execute the DataAdapter.Update(...) method for the first time. Howerver subsequent calls to Update(...) will succeed.

Attached I have created a simple demo to show the problem. I this demo i rely on Oracle's sample HR Schema. But this error will be raised in any case

Any help is greatly appreciated.

Thanks in advance,


DB Version: Oracle

MS .Net 4.8 Console Application

Post Details
Added on Aug 25 2020