Win7 under. NET connection Oracle, prompt error ocienvcreate failed, return code is-1, but error message text is not available in __ programming

Source: Internet
Author: User

The last three days have been painful, by Oracle and. NET connection between the head is big, after not only the installation and find the reason, finally made clear about two points:

(1) System.Data.OracleClient requires Oracle client software 8.1.7 or later

(2) System.Exception:OCIEnvCreate failed with the return code of-1, but the error message text is not available.

solve the problem one:

A connection to the database is an error, just started popping up

"System.Data.OracleClient requires Oracle client software 8.1.7 or later"

Workaround: At first I felt that I was using WebService to invoke the Oracle database for remote services, and I did not operate an Oracle database, so I didn't have to install the Oracle database on my computer, which is theoretically the case, but it turned out to be wrong, and concluded: C # Write WebService when you invoke a remote Oracle database, the client is also installed on this computer, and Java is not required. The problem is resolved after installing the client.

solve the problem two:

Win7. net2008 Connect Oracle, Prompt for error ocienvcreate failure, return code is-1, but error message text not available

The following error occurred while operating Oracle:

System.Exception:OCIEnvCreate failed with the return code of-1, but the error message text is not available.

In System.Data.ProviderBase.DbConnectionPool.GetConnection (DbConnection owningobject)

In System.Data.ProviderBase.DbConnectionFactory.GetConnection (DbConnection owningconnection)

In System.Data.ProviderBase.DbConnectionClosed.OpenConnection (DbConnection outerconnection, dbconnectionfactory ConnectionFactory)

In System.Data.OracleClient.OracleConnection.Open ()

I am using webservice to invoke the remote server Oracle database, this machine does not install Oracle

After a day of online looking for information, and constantly debugging and installation, finally found the reason:

Everything is WIN7 security mode, permissions issues, under Win7 to run all incompatible software with administrator status

Solution: Find vs2008, right-click "Run as admin", start vs2008, then open Project/solution, select your program, run, pass.

The reason why the above error, because the identity is not enough to run as an administrator on the OK

Summary: WIN7 has more administrator privileges than XP, which is right-click the program to run as an administrator

Therefore, when your program, code in the XP can run, and in the Win7 under the pop-up error, try this method, in your program right click "Run as Administrator", generally can solve the problem.

Pl/sql also want to run as an administrator, otherwise it is not even on.

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.