locked
ERROR : The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception RRS feed

  • Question

  • User-633041827 posted

    Hi, I'm trying to implement the Oracle Data Provider for .NET (ODP.NET)  to connect to the oracle data base. I added a reference of the dll in the project and using the follwoing code.

    Imports Oracle.DataAccess.Client

    con = New OracleConnection("User Id=user;Password=passwordr;Data Source=somedatabase)

    con.Open()

    I'm getting the error..ERROR : The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception

    I'm i missing something

    Friday, December 9, 2011 8:24 AM

All replies

  • User269602965 posted

    Yes, what is missing is "More details requiired to help you"

    Where is the code running?  What version of ODP.NET client are you using?

    Where is the Oracle.DataAccess.dll located? and if in the project, is your reference LOCAL?

    Where is the database?  What version is the database?

    Are you running in a 32-bit or 64-bit environment?  If 64-bit, is the application set to AUTO or explicit compile for 64-bit?

    Is this ASP.NET web project or Windows Forms project, etc.?

    What does your connection string look like in the project configuration (web.config, etc.)

    Is there more to your test connection code, like con.Close()

    etc.

     

     

    Friday, December 9, 2011 9:25 AM