Solved

Setting up connecting to Oracle from VB.NET in 64bit environment

Posted on 2014-09-24
2
1,141 Views
Last Modified: 2014-10-06
I'm using VS 2010 on a Windows 7 (64bit) development machine and running my app on a Windows Server 2008 64bit server. I'm using .NET 2.0

Is there step-by-step instructions on how to set up for connecting to an Oracle 10g database?

In my web.config:

  <connectionStrings>
    <remove name="CentOracleServer"/>
    <add name="CentOracleServer" connectionString="Data Source=CENTRALIZED;User ID=user;Password=pass;pooling=true;min pool size=5;Max Pool Size=60" providerName="Oracle.DataAccess.Client"/>
  </connectionStrings>

Open in new window


On my page:

Imports Oracle.DataAccess.Client        
Dim oOracleConn As OracleConnection = New OracleConnection()
        oOracleConn.ConnectionString = GetConnString()
        oOracleConn.Open()
        oOracleConn.Close()

Open in new window


When I try to run it through the IDE on my dev box, I get:

Could not load file or assembly 'Oracle.DataAccess, Version=2.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. An attempt was made to load a program with an incorrect format.
0
Comment
Question by:Mike Miller
  • 2
2 Comments
 
LVL 77

Accepted Solution

by:
slightwv (䄆 Netminder) earned 500 total points
ID: 40342449
Make sure you downloaded the 64Bit version of ODP.Net.

Since this is all new, I would suggest you start using the new Managed Driver.  Then you don't need a complete Oracle Client install.

I've started experimenting with in in development and seem happy thus far.

All the 64Bit drivers can be found here:
http://www.oracle.com/technetwork/database/windows/downloads/index-090165.html
0
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 40342455
I suppose I should have said:
Make sure the bit version of the app you are developing matches the bit version of the ODP driver you installed.

If it is a 32Bit app, you need the 32Bit drivers.

Going from memory here but there may be issues with the AnyCPU compiler directive.  Try forcing it to match the driver you installed.
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question