Website compiled in 64bit not connecting to sql server
===

I have a strange problem.
I have web application that use both Oracle and sql server 2008.
I want to use the Oracle Data Provider for .NET 64bit version.
in order to that i am setting the application pool to enable 32 bit = false, otherwise the ODT.NET 64bit is not working.
So also i had to compile the assemblies to be 64bit.
but when i do so i'm getting the following error from sql server:

    A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections.

when i compile back to any cpu it's working fine, but again  only if i set the application pool to enable 32bit=true.

what make things even more strange is that in my test and pre prod servers it's working fine with 64bit setup both for sql server and oracle.

but in my prod server i keep getting this error from sql.

so maybe it's IIS problem in my prod machine?

what  i did so far is to compare all the settings in the iis to be the same in all machines, but it didn't solve the problem.

what could it be?

