Solved

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

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
levels for reporting 5 50
SQL Retrieve Values 4 41
Get list of word ducuments in a folder 10 14
Adjust the position 3 7
Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
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.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

708 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

18 Experts available now in Live!

Get 1:1 Help Now