I'm trying to connect to my Oracle Database from my new PC. I've just installed Visual Studio and the ODAC. But when I try to do a simple connect Im getting an exception with an empty message, empty source, empty number, just with the error code which is -2147467259.
OracleConnection Prueba;
Prueba = new OracleConnection("Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=XXX.XXX.XXX.XXX)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=XXXX)));User Id=XXX;Password=XXX;Pooling=true;Max Pool Size=10;Min Pool Size=1");
Prueba.Open();
Exception Details
This is the Exception.ToString() code:
"Oracle.DataAccess.Client.OracleException at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure)
at Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, Object src)
at Oracle.DataAccess.Client.OracleConnection.Open()
at OracleConnectionS.Program.Main(String[] args) in C:\Users\Simetri\Documents\Visual Studio 2010\Projects\OracleConnection\OracleConnection\Program.cs:line 19"
Any idea about why could this be happening?
UPDATE
If I run visual studio as Administrator I dont get the exception and I can connect to the database just fine.
I tried giving FULL CONTROL permission to the Oracle Directory C:\Oracle
. But if I run Visual Studio in a normal way (not as administrator) I keep getting the exception.
Background Info
- I'm using Windows 7 64 bit
- Visual Studio 2010
- I can connect just find with SQL*PLUS
So after installing all sort of versions of ODAC and searching to every single post related to this.
At the end Clean Install of the 32bit version was the solution.
WHY?
Well is something related to the version in which Visual Studio is developed in. If you are developing a console application you will have not problem with the client version, but if you are using a web project then you definitely need the 32 bit version.