Last post Aug 14, 2012 05:55 PM by sebichondo
Jun 13, 2008 10:36 PM|rean|LINK
I have a VB .Net 2.0 web application which accesses oracle 8i database, the database was upgraded to 9i later on. The application worked fine just before the upgrade was made, but after the upgrade the application gives the following error.
The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception.
I did a few searches in the oracle forums and downloaded and installed the Oracle Data Provider for .NET version 220.127.116.11 form orcale website but the application still throws out the above exception.
following is the stack trace of the application from the point of failure
would really any kind of help on this, i have already spent days working on this.
thanks in advance
Jun 16, 2008 04:03 AMemail@example.com|LINK
u add the namespace of oracle and checkout.
Jun 17, 2008 04:10 PM|rean|LINK
but the error was got inspite of the namespace.
thing is im really not able to pinpoint the source of the error, i have been able to make connection to the database and all but still not running.
Jun 17, 2008 10:52 PM|greg.darling|LINK
TypeInitializerException occurs when Oracle.DataAccess.dll finds the wrong version of client dll's, or doesnt find them at all. The exception message indicates you're using
18.104.22.168 opd.net. So, you'll need 22.214.171.124 oraops10w.dll in your Oracle\bin directory, along with the rest of a 10.2 client install as well. Is that what you have? Does the 10.2 come before any other Oracle homes in your PATH
Hope it helps,
Jun 18, 2008 07:49 PM|rean|LINK
Thankyou for replying. I m using orcale version 9i. i found the OraOps9.dll in the c/software/bin i guess thats bcoz thats the folder i downlaoded the file ODAC 126.96.36.199.0. I have orant for windows NT and the version of the oracle database is Oracle9i Enterprise
Edition Release 188.8.131.52.0.
Jun 18, 2008 08:11 PM|greg.darling|LINK
It may be your intent to use 9.2 odp, but your exception stack shows
Oracle.DataAccess.Client.OracleException, Oracle.DataAccess, Version=184.108.40.206
You're using 2.x framework so need to be at a minumum of 10.2.0.2.20 ODP which is the first version of ODP to support .NET2.x, and System.Transactions which is also in the stack. As stated previously, 10.2 odp requires a 10.2 client as well.
You need to find out what the software requirements are for the app you're using. You cant use an ODP/client older than what the software was compiled with. Based on what I see in the exception message, you should be using at least 10.2.0.2.20
Jun 19, 2008 08:06 PM|rean|LINK
i guess what you are trying to say here is that i have downloaded the wrong version of ODP.Net for my application.
greg would you be patient enough to tell me what kind provider is suitable for oracle 9i, i know for sure that the database this application is using is version 9i.
below is the stack trace of the application without installing the odp.net
A first chance exception of type 'System.TypeInitializationException' occurred in WebApplication2.DLL"
i thght it was the problem with the provider.
really appreciate your replies.
thanks in advance.
Jun 19, 2008 09:55 PM|rean|LINK
thankyou for your tip, your hint got me thinking about doing some research on the System.Data.OracleClient namespace.
I replaced the odp.net namespaces Oracle.DataAccess.Client and
Oracle.DataAccess.Types with that of System.Data.OracleClient and it started to work.
I guess the System.Data.OracleClient didnt work previously becoz it was version 1.0.3300.0 and im guessing that when i downlaoded odp.net it must have downlaoded the System.Data.OracleClient version 2.0. so may be that did the trick.
but thankyou for your valuable input, it helped me a lot.
Aug 18, 2010 04:40 AM|riteshkothari99|LINK
I simply removed and added again the reference lib for System.Data.OracleClient and the error was gone.
Aug 14, 2012 05:55 PM|sebichondo|LINK
Yes, adding oraops10w in Oracle\bin resolved the issue and saved me hours of debugging.