EDIT: The fully managed ODP.NET is now available in production. It is very small (less than 10MB) and is not dependent on other files. You can obtain it here:
http://www.oracle.com/technetwork/topics/dotnet/downloads/index.html
Original answer:
One way to easily ensure that the required Oracle client side software (including ODP.NET) is always available on the deployment machine is to embed it with your application. ODP.NET has gotten a lot easier to embed now that XCOPY ODP.NET is available. You can download it from this link:
http://www.oracle.com/technology/software/tech/windows/odpnet/index.html
With XCOPY ODP.NET, all you need to do when you deploy your application is the following:
1) Copy your application to the target machine
2) Run "install.bat" which copies a couple of Oracle DLL's to the target machine (including ODP.NET and the Oracle client side (OCI) software)
3) Run "configure.bat", which does a "gacutil" and updates the registry of the target machine
4) Provide your application with connect string information. You can use the EZCONNECT connect string ("hostname@servicename") or you (or your customer) can share preexisting sqlnet configurations by setting the TNS_ADMIN registry entry or environment variable to point to another Oracle home that has sqlnet connect aliases already configured.
That's it! It is really that simple.
I hope you will take a good look at ODP.NET XCOPY in the link above to see for yourself how easy it is these days to embed ODP.NET with your app.
Additional notes:
If you choose not to embed ODP.NET with your application, in both the case of Microsoft OracleClient and in the case of ODP.NET, there needs to be additional Oracle client side (OCI) software installed on any deployment machine. The only difference between the two cases is that when you are using ODP.NET, it also needs to exist on the deployment machine. The good news is that a typical Oracle install on your customer machine will include ODP.NET already.
Now, if your target machine already has ODP.NET installed you don't need to do anything else. You just need to distribute your application. If you do need to install ODP.NET using the standard installer, you can also download it from the link provided above. The standard ODP.NET install only takes a few minutes and configures everything for you.
And again, you can use EZConnect connect strings to make networking configuration a piece of cake, or use the TNS_ADMIN registry entry or environment variable to take advantage of pre-existing connect aliases that your customer is already used to using.
Hope this helps,
Christian Shay
Oracle
Feel free to provide your feedback on this and other future features at our feature request website:
http://apex.oracle.com/pls/apex/f?p=18357:46
I hope the following steps will give you the correct result.
To replace System.Data.OracleClient with Oracle.DataAccess.Client; and Oracle.DataAccess.Types
Download and install the latest version of Microsoft Enterprise Library ver 3.1 Can be found here:- http://msdn2.microsoft.com/en-us/library/aa480453.aspx
Download and install the Oracle ODP.Net from Oracle website Your DLL file should be in :-
C:\oracle\product\11.1.0\client_1\odp.net\bin\2.x\Oracle.DataAccess.dll
When it prompts you to install the source do so by using the checkbox.
If you didn't then run the msi on the following path C:\Program Files\Microsoft Enterprise Library 3.1 - May 2007\src
The code for the library gets stored on the following path C:\EntLib3Src\App Blocks
Take a backup of the original src folder in case you need them later - C:\EntLib3Src\App Blocks\Src
Open the solution file EnterpriseLibrary.sln And get to the data project under Data Access Application Block
Add Oracle.DataAccess.dll Reference to the Data Project. Your DLL file should be in :- C:\oracle\product\11.1.0\client_1\odp.net\bin\2.x\Oracle.DataAccess.dll
Search and replace the following [ Instead you could download and use the updated DLL thats attached to this article]
File :- C:\EntLib3Src\App Blocks\Src\Data\Oracle\OracleDatabase.cs
File :- C:\EntLib3Src\App Blocks\Src\Data\DatabaseConfigurationView.cs
File :- C:\EntLib3Src\App Blocks\Src\Data\Oracle\OracleDataReaderWrapper.cs
Find :- using System.Data.OracleClient;
Replace with:- using Oracle.DataAccess.Client; using Oracle.DataAccess.Types;
File :- C:\EntLib3Src\App Blocks\Src\Data\Configuration\DbProviderMapping.cs Class:- DbProviderMapping
Find :- System.Data.OracleClient
Replace with:- Oracle.DataAccess.Client
File :- C:\EntLib3Src\App Blocks\Src\Data\Configuration\Manageability\
ConnectionStringsManageabilityProvider.cs
Method:- AddAdministrativeTemplateDirectives
Find :- System.Data.OracleClient
Replace with:- Oracle.DataAccess.Client
File :- C:\EntLib3Src\App Blocks\Src\Data\Oracle\OracleDatabase.cs
Method:- AddParameter
Find :- public void AddParameter(OracleCommand command, string name, OracleType oracleType, int size, ParameterDirection direction, bool nullable, byte precision, byte scale, string sourceColumn, DataRowVersion sourceVersion, object value)
Replace with:- public void AddParameter(OracleCommand command, string name, OracleDbType oracleType, int size, ParameterDirection direction, bool nullable, byte precision, byte scale, string sourceColumn, DataRowVersion sourceVersion, object value)
Reason:- OracleType replaced with OracleDbType as the third parameter as that the type name in the odp.net API
File:- C:\EntLib3Src\App Blocks\Src\Data\Oracle\OracleDatabase.cs
Remove:- [OraclePermission(SecurityAction.Demand)]
-
Haven't got a clue what that does if someone does please brief on feedback session
File:- C:\EntLib3Src\App Blocks\Src\Data\Oracle\OracleDatabase.cs
Find:- OracleType.Raw
Replace with:- OracleDbType.Raw
Find:- param.OracleType
Replace with:- param.OracleDbType
Find:- OracleType.Cursor
Replace with:- OracleDbType.RefCursor
Find:- parameter.OracleType
Replace with:- parameter.OracleDbType
Compile now and if you get an error do the following Warning as Error : XML comment on - Remove the highlighted error content / replace it with approp comment Hopefully it should compile fine now.
Now the DLL that was generated by compiling the above project can be used against both SqlServer and Oracle [ODP.Net]
Best Answer
It works fine for me using ODP.net 11 and this connection string (with a tnsnames.ora file in the Oracle client to define DLGP):
Data Source=DLGP;User Id=/;Password=;
Your sqnet.ora file needs to be setup correctly for this to work, but that should already be the case if SQLPlus can connect. Do you only have one Oracle home? If ODP.net is picking up a second one that can muck things up nicely (and that can happen depending on how you install it).