Case study of ASP. Net being unable to connect to Oracle due to Environment Variables

Source: Internet
Author: User

This article describes how ASP. Net cannot be connected.OracleIn this case, an old system developed by vs2003 has no problem in local debugging. After being released to the server, it is found that the database cannot be connected. The following error is reported during the Open process:

System. Data. OracleClient requires Oracle client software version 8.1.7 or greater.

I have read a lot on the Internet, but it is said that the permission settings of the Oracle directory are incorrect. Therefore, the permission of the Oracle directory is set to full control of Everyone, but it does not work at all. Do you want to restart the server? I restarted the server and tested it three minutes later. the problem persists.

Is it a problem with development tools? Open VS2008 and create a new website to test the database connection. However, the same error is still reported.

When I'm depressed, I seeToad, Open Toad and try again, and the result cannot connect to the database. The Error "Can't initialize OCI. Error-1" is displayed. I have seen this Toad error, which means the systemEnvironment VariableThere is no BIN directory for Oracle. Open cmd and enter echo % path % to view the value of the system Path variable. The BIN directory of Oracle does not exist in several directories. It seems that the problem was originally found here.

Solution:

Right-click my computer-> content-> advanced-> environment variables-> double-click the Path item in system variables, enter a semicolon at the end of the variable value, and then enter the Bin directory C of Oracle: \ oracle \ product \ 10.2.0 \ client_1 \ BIN paste in, and then click three OK to return to the desktop. Open a cmd window again, input echo % path %, and find that there is a BIN directory of Oracle, so that the Path is set. Finally, run iisreset to restart IIS. The problem is fixed.

Through this case, we learned that when we solve the problem, we should not just find a solution based on the conventional ideas, but consider multiple aspects to broaden our thinking, the problem may be solved.

This article introduces you here. Thank you for your support!

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.