Last post Aug 08, 2014 06:07 PM by Lannie
Aug 05, 2014 04:19 PM|sn002|LINK
I have 2 systems - 2k8 server with oracle 32bit and 2k8 server with oracle 64bit.
I am testing the same OracleChk.aspx page on both systems.
2k8 server with oracle 32 bit gives no errors.
2k8 server with oracle 64bit gives the following errors:
error cs0234: The type or namespace name 'OracleClient' doesn't exist in the namespace 'System.Data' (Are you missing an assembly reference?)
Does it mean OracleClient only work on Oracle 32 bit? Please advice. thanks
public partial class CheckOra : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)
OracleConnection sConn = new OracleConnection("Password=xxx;User ID=xxx;Data Source=Hello.WORLD;Persist Security Info=True;");
catch (Exception ex)
Response.Write("Could not establish connection:<br /><br />" + ex.Message);
Aug 05, 2014 07:44 PM|Lannie|LINK
You have to use the 64-bit Oracle.DataAccess.dll when using the 64-bit Oracle client installed on your 64-bit application server
and of course, compile the page as 64-bit.
I obtain the exact version and bitness of Oracle.DataAccess.dll to match the client (look in your Oracle client HOME > ODP.NET > BIN > 4 directory
and place it in the /BIN directory of the application, make LOCAL reference, and compile to avoid confusion.
Aug 06, 2014 09:57 AM|sn002|LINK
I followed your steps and I got different error:
Could not load file or assembly 'Oracle.DataAccess' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
Does it mean I need a newer version of runtime Java on my system?
Aug 06, 2014 06:50 PM|Lannie|LINK
On the Windows 2008 64-bit machine where is the Database being called by the application?
What version and bitness is the Oracle database?
Aug 07, 2014 01:05 PM|sn002|LINK
The database resides on another 2k8 server. Oracle 11gR2 64bit
Aug 07, 2014 08:04 PM|Lannie|LINK
Yes Good database. I use that too.
Let's back up and do clean install.
Uninstall Oracle client(s) on the application server.
Go to registry HKEY Local Machine > Software and remove the Oracle Key
Find your Oracle home and make sure it is an empty directory
Reboot and install this driver and Client. When you run the installer, use the CLIENT INSTALLATION option.
64-bit ODAC 11.2 Release 5 (126.96.36.199.20) for Windows x64
ODAC1120320_x64.zip - 225 MB (230,297,429 bytes)
make sure you can execute a test query from SQL PLUS prompt to ensure good connection to database
(no firewall issues blocking Oracle listening port, tnsnames.ora properly configured, etc.)
Then follow my previous steps to obtain the exact same oracledataaccess.dll used by your client install
with LOCALreference made to it in the /BIN directory of APP.
And make sure your application is explicitly compiled at x64 and not ANY or x86.
Aug 07, 2014 08:09 PM|Lannie|LINK
And remove these from your code
using System.Data.SqlClient; (for MS SQL)
Aug 07, 2014 11:05 PM|sn002|LINK
Thanks I will ask the database guy intall the new Oracle client.
The above page is one of the pages I am trying to migrate from 2k3 server to 2k8 server. So far I already seen some errors like above error. Since all of the applications are written to run on 2k3 server (32bit) machine with .Net Framework 2.0, what I
need to do in order to make those applications to work on 2k8 server 64bit?
What Oracle client should I install since all applications are written for .Net framework 2.0 to begin with?
I need to change all pages to - using Oracle.DataAccess.Client;
Aug 08, 2014 06:07 PM|Lannie|LINK
The above referenced installation link supports .NET 2.0/3.5 and .NET 4.0
But of course, you need to go into the ODP.NET folder of your Oracle home to get the right oracle.dataaccess.dll
home/odp.net/bin/2.x/Oracle.DataAccess.dll for .NET 2.0/3.5 apps
home/odp.net/bin/4/Oracle.DataAccess.dll for .NET 4.0 compiled apps
copy the dll you need into the /BIN folder of your app and make local reference.