Solved

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

Posted on 2014-09-24
2
1,124 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:mwmiller78
  • 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Via a live example, show how to take different types of Oracle backups using RMAN.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

815 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now