Solved

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

Posted on 2014-09-24
2
1,152 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
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 videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

726 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