Friday, December 01, 2006

More on Oracle Client and the different providers for .NET

Remember next time you write a web service or DAL class that connects to an Oracle database. If using the version 1.1 of the Framework and the Microsoft Oracle Provider, this provider has a known bug when the service name is longer than 16 characters:

The exception that you will get when trying to open the connection is:
ORA-00162: external dbid length xx is greater than maximum (16)

more on the topic can be found here

The workarounds are:
1) putting the whole tnsnames.ora entry in the DataSource entry of your connection string or

2) use Oracle's data provider (ODP.NET)
3) set the TNSADMIN environment variable to point to a different directory
where you keep a modified tnsnames.ora file.

more on the troubles with the Oracle Native Provider for .NET (ODP.NET) whenever i have a chance to write again...


Post a Comment

<< Home