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.