Note:This documentation/guide is based on Managed ODP.NET v11.2.0.3.50 Beta
Download Managed ODP.NET from Oracle Technology Network.
Finally Oracle has released a pure .NET based client for connecting and working with Oracle databases from your CLR world without the dependencies lying around in the GC ignorant world. With a reference added to the Oracle.ManagedDataAccess.dll which weighs a mere 6+ MB’s (against 150+ MB’s previously) you are ready to get started with you day-to-day interaction to the 10g R2 or higher Oracle Databases.
It is not without its quirks though, but for me the advantages have outweighed the issues and I have started using them in my current development even though it is still in Beta.
Let’s get started with accomplishing something than me doing the happy dance any longer.
With Managed ODP.NET now you would be able to provide the connection configurations as part of the application configuration settings. For a detailed information on all possible configuration settings check out the documentation on OTN.
Generally you would simply add the needed connection string as
|
|
and use that in your application. But since the Managed ODP.NET is self contained, Oracle is providing 3 options for resolving the TNS “oracle” in the above connection string;
|
|
oracle.manageddataaccess.client
configuration section provide settings for the TNS_ADMIN
variable
|
|
oracle.manageddataaccess.client
provide the dataSource
description separately
|
|
Note: The oracle.manageddataaccess.client
section needs to be declared in the configSections
as follows:
|
|
If you have previous experience with writing code for ODP.NET, mostly the only change you are going to do is remove the filthy old ODP.NET reference, add the new managed ODP.NET reference and change the namespace on the top of your code files from using Oracle.DataAccess.Client; using Oracle.DataAccess.Types; to using Oracle.ManagedDataAccess.Client; using Oracle.ManagedDataAccess.Types; and it should work just fine.
|
|
Sample from http://www.oracle.com/technetwork/database/windows/downloads/odpmbetainstall-1696475.html
There are limitations on the Managed ODP.NET which may or may not affect you, please refer to the [documentation on the same](http://www.oracle.com/technetwork/database/windows/downloads/odpmbetainstall-1696475.html#Known Issues).
Overall, the Managed ODP.NET seems to be a great step for Oracle in the way to support Microsoft .NET developer community. It is also great for server administrators as they do not have to face various issues with version compatibility as was with the native ODP.NET / Wrapper version.