Solved

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

Posted on 2014-09-24
2
1,134 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 76

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 76

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo 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.

809 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