Migration from OracleClient to dotConnect for Oracle
In This Topic
Note: |
This topic is applicable only for full .NET Framework.
|
According to this post in the ADO.NET team blog, Microsoft deprecates OracleClient as a part of ADO.NET roadmap. Microsoft strongly recommends customers to use third-party ADO.NET providers for Oracle instead of continuing to use Microsoft?s OracleClient for new application development.
dotConnect for Oracle is fast and reliable ADO.NET provider for the wide range of users. It is the most compatible with OracleClient provider, and it provides the easiest migration from OracleClient. It allows you to migrate easily without effort.
We have researched problems, which users may encounter when migrating from OracleClient to dotConnect for Oracle:
- Interface differences.
Almost all differences in the names of the classes, methods, and fields between OracleClient and dotConnect for Oracle were removed. Migration Wizard will solve the problems with the minor differences that still exist.
- Behavior differences.
We have thoroughly researched the OracleClient provider behavior and compared it with the behavior of our provider. We also have adopted our autotests to the OracleClient and gained their successful execution. All the behavior differences were eliminated, and now you can switch the dotConnect for Oracle to the compatibility mode with OracleUtils.OracleClientCompatible variable.
Migration
Our Migration Wizard makes the migration from the OracleClient to dotConnect for Oracle as easy as the two following steps:
- Open the Migration Wizard by choosing Migration Wizard from the Tools -> Oracle menu and in the appeared wizard click the Next button. Then choose the provider to convert from and whether to convert entire solution or the active project only and click Finish.
- Set OracleUtils.OracleClientCompatible to true in your code.
Then you may compile and use your project.
Setting OracleUtils.OracleClientCompatible to true makes the following changes to dotConnect for Oracle behavior:
- An OracleDateTime instance is returned for a TIMESTAMP data type instead of OracleTimeStamp
- An OracleTimeSpan instance is returned for an INTERVAL DAY TO SECOND data type instead of OracleIntervalDS
- An OracleMonthSpan instance is returned for an INTERVAL YEAR TO MONTH data type instead of OracleIntervalYM
- The OracleDataReader and OracleArrayDataReader allow calling GetOracleDateTime(), GetOracleTimeSpan(), and GetOracleMonthSpan() methods.
- A parameter, representing the result of a described function, is named "RETURN_VALUE" instead of "RESULT".
- If a value, assigned to OracleParameter.ParameterName starts with a colon, the colon is not trimmed off.
- Parameters are always passed by names when executing a stored procedure via OracleCommand.
Example
We created an example for such migration from the MSDN code samples.
The sample project can be downloaded here. Then we used the Migration Wizard to migrate this project from OracleClient to dotConnect for Oracle, and inserted OracleUtils.OracleClientCompatible = true into the code. Everything works in the same way as before the migration. Migrated project can be downloaded here.
See Also
Comparing Data Providers for Oracle