Click here to Skip to main content
15,879,535 members
Articles / Web Development / ASP.NET
Tip/Trick

Attempt to load Oracle client libraries threw BadImageFormatException. This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed

Rate me:
Please Sign up or sign in to vote.
3.00/5 (2 votes)
19 Dec 2010CPOL1 min read 90.2K   1   5
ASP.NET website project hosted on IIS 7.5 running on Windows 2008 R2 is unable to connect to ‘Oracle’ database.

Problem Statement


"Attempt to load Oracle client libraries threw BadImageFormatException. This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed."


Reason 1#


There could be a possibility that Oracle Client 64 bit(drivers) is not installed properly on Windows 2008 r2. This improper installation of Oracle Client doesn't affect connectivity with Oracle for .NET Windows or Console application. It affects only Web based applications.


Solution


To check whether Oracle Client is installed properly or not, follow the following steps.



  1. Create one UDL file: Create one text file and name it as "conn.udl".
  2. Open conn.udl file. By opening that file, you will see a window as shown below:

  3. Select "Microsoft OLE DB Provider for Oracle" and click on Next button which will take you to the next tab "Connection".
  4. In this Connection tab, Give Database server name, User name and password and click on Test Connection. If all the Credentials are correct and required TNS entry is there in tnsnames.ora file, then it will give a connection successful message as shown below. If this message is coming, then Oracle Client installation is done properly.


Conclusion


Connectivity of ASP.NET With Oracle Client can be because of improper installation of Oracle Client on the server. So this is the basic Check we can do to verify it.


License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
Questionmicrosoft oledb provider for ORACL Pin
Member 1084918527-May-14 23:49
Member 1084918527-May-14 23:49 
AnswerRe: microsoft oledb provider for ORACL Pin
WernfriedD22-Dec-15 23:36
WernfriedD22-Dec-15 23:36 
Questionwhat if there is no option of 'Microsoft OLE DB Provider for Oracle' in the udl file? Pin
Sadaqatullah Noonari25-Dec-12 8:44
Sadaqatullah Noonari25-Dec-12 8:44 
AnswerRe: what if there is no option of 'Microsoft OLE DB Provider for Oracle' in the udl file? Pin
WernfriedD22-Dec-15 23:36
WernfriedD22-Dec-15 23:36 
GeneralMy vote of 1 Pin
Deulis6-Jul-12 9:38
Deulis6-Jul-12 9:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.