C # questions and solutions for connecting to Oracle on a 64-bit operating system)

Source: Internet
Author: User
C # Use System. Data. oracleclient to connect to the Oracle database. Previously running normally on WINXPProgramAfter porting to Windows 2008 x64, the database cannot be connected. The error message is as follows:

Badimagefomatexception is thrown when you try to load the Oracle client library. This problem occurs when the 32-bit Oracle client component is installed in 64-Bit mode.

The cause of the error is that the oracleinstantclient installed on the WINXP host is 32 bits, so the oracleclient used by the compiled program is also 32 bits, resulting in compatibility problems. Of course, if you reinstall the 64-bit Oracle client on the 64-bit operating system and re-compile the program, the problem can also be solved. Here we will introduce a simple method to transplant the program.

In fact, system. Data. oracleclient points to OCI. dll under the path environment variable. Therefore, we only need to allow the program to find the 64-bit OCI. dll. The method is as follows:

1. Download and unzip, such as c: \ instantclient-basic-win-x86-64-11.1.

2. Add the above path to the system environment variable path.

Then run the program. The program searches for OCI Based on the path. DLL, if you encounter a 32-bit OCI. the dll will automatically skip and find the 64-bit OCI. DLL to connect to the database.

For more information, see Jeffrey's blog.

 

Here we will update the patch connection:Http://www.oracle.com/technology/global/cn/software/tech/oci/instantclient/htdocs/winx64soft.html? _ Template =/ocom/print

Oracle client download link: http://www.oracle.com/technology/software/products/database/index.html

If not, please download oracle64-bit latest client: http://download.oracle.com/otn/nt/oracle10g/10204/10204_vista_w2k8_x64_production_client.zip

 

See this link for details: http://www.dbatoolz.com/t/installing-oracle-instantclient-basic-and-instantclient-sqlplus-on-win32.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.