Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problem: Access Oracle DB (OracleConnection Class)

Tiago AlmeidaDec 10 2015 — edited Dec 11 2015

Hi,

I am with a problem. I searched a lot, but nothing that I tried worked!

I want to access an Oracle Database 11g. I am writting a small C# program in Visual Studio Express 2012 (using windows 7 - 32 bits) to perform this task. However, I am with an error that i am not capable to solve.

The error happens in the first line of my code, when I try to create the object con: OracleConnection con = new OracleConnection();

I have not compilation problems.

When I run the program the output is:

An unhandled exception of type 'System.TypeInitializationException' occurred in ConsoleApplication5.exe

Additional information: The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception.

I added "Oracle.DataAccess.Client" by installing "Oracle Data Provider for .NET (ODP.NET) x86" (using the Visual Studio's NuGet packages) to use the OracleConnection Class. I already installed the content of a zip file that I downloaded in Oracle website: ODP.NET_Managed_ODAC12cR4.zip. What am I missing? Or what is wrong?


Thanks for the help! I am new in this world


Best Regards,

Tiago Almeida

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 8 2016
Added on Dec 10 2015
2 comments
1,132 views