views:

170

answers:

2

Hello,

I am using attempting to create a connection to an Oracle database via entity framework in Visual Studio 2008. I am running 64 bit Vista Ultimate.

At first, I had difficulty even making a connection to the db through Visual Studio, but eventually got things working by installing 10204_vista_w2k8_x64_production_db AND ODTwithODAC1110720, but only the minimal parts needed to interface via Visual Studio.

I am completely new to this setup, so it's likely I have already made a mistake, but installing both packages is the only way I could create a connection via Visual Studio.

I made the connection, and used the wizard to create a . edmx file. The model and associations were created perfectly, and I thought things were going to work well. I used the default name "Entities" as the reference name.

When I try to do the following

filingsContext = New Entities()
filingsContext.TABLE_NAME_HERE.First()

I get this following error..

InnerException = {"Unable to load C:\app\adexter\OraHome_1\oci.dll. Please check that you use 64x version of Oracle client with 64x application."}

How is it that I can connect to the oracle db at every point except when I'm running the application?

+1  A: 

The problem you are running into is that you are trying to load a 32 bit version of the DLL within a 64 bit application. Try switching your Visual Basic application to target 32 bit / x86 and that should fix the problem

  1. Right Click on the project in solution explorer
  2. Select Properties
  3. Go to the Compile Tab
  4. Click on Advanced Compile Options
  5. Change Target CPU Combo to x86
  6. Hit OK
JaredPar
Thanks for your reply! This did work. I tried something similar earlier with the configuration manager, but was turned off by other errors popping up. However, they don't seem to be preventing the app from running, and I appear to be able to get a connection to the db. Thank you! I am, however, now receiving several errors, most are likeCould not load assembly or xml documentation file. Could not load file or assembly <path to project .EXE> or one of its dependencies. An attempt was made to load a program with an incorrect format.It appears that these are failing build events?
Alex
+1  A: 

Make sure you have installed the 64 bits version of ODT with ODAC.

Look at this answer on how to make sure which client version your application will use (some links at the end target more specifically the C# language, but they can be adapted to VB .NEt).

Mac