Currently, we are using the ODP.NET-19.3 Oracle.DataAccess.dll (product version - 4.122.19.1.20190703) in our projects.
We are facing the “Specified cast is not valid” error issue when casting the large precision number (29 digits or more) to decimal.
The propery SuppressGetDecimalInvalidCastException is introduced in the ODP.NET-19.10. This will handle our issue.
So, I have removed the old Oracle.DataAccess.dll references and used the latest Oracle.DataAccess.dll (product version - 4.122.19.1.20220601) in our projects and used the newly added property SuppressGetDecimalInvalidCastException when initializing the OracleDataAdapter class. The project is compiled successfully but during the runtime Method not found: ‘Void Oracle.DataAccess.Client.OracleDataAdapter.set_SuppressGetDecimalInvalidCastException(Boolean)’ exception is thrown.
var adapter = new OracleDataAdapter() //Old Code
var adapter = new OracleDataAdapter() { SuppressGetDecimalInvalidCastException = true } //New Code
Why the replacing the old Oracle.DataAccess.dll with the latest Oracle.DataAccess.dll is not working?
Do I need to install(upgrade) the latest ODP.NET 19.10 - Oracle client to solve the issue?
Can anyone help to solve the issue?