[英]Connect Oracle DB using 64 bit Oracle Client from 32 bit process
I have application running in 32 bit mode. 我的应用程序以32位模式运行。 it tries to connect oracle DB using Oracle Client.
它尝试使用Oracle Client连接oracle DB。 Oracle Client is running in 64 bit.
Oracle Client以64位运行。
string connectionString = @"Data Source=" + oracleDBName + ";User id=" + oracleDBUserId +";Password=" + oracleDBPwd +";";
OracleConnection con = new OracleConnection(connectionString);
try
{
con.Open();
if (con != null)
{
con.Open();
}
return true;
}
catch (OracleException)
{
return false;
}
I am getting targetinvocationexception when i call 我打电话时收到targetinvocationexception
con.Open();
con.Open();
Reason, It is not able to load 64 bit dll since the application is running in 32 bit mode. 原因,由于应用程序以32位模式运行,因此无法加载64位dll。
I cannot change the application mode. 我无法更改应用程序模式。 I also cannot install the 32 bit Oracle client.
我也无法安装32位Oracle客户端。 How to solve this problem
如何解决这个问题呢
Thanks in Advance 提前致谢
Oracle driver for .NET "requires native" client from Oracle. 用于.NET的Oracle驱动程序“需要Oracle提供本机”客户端。 (It's not Java, where thin client exists)
(不是Java,瘦客户机存在)
Try instant client, it doesn't require installation. 试试即时客户端,它不需要安装。 http://www.oracle.com/technetwork/topics/winsoft-085727.html
http://www.oracle.com/technetwork/topics/winsoft-085727.html
Also, you can try ODBC .NET driver, but configure ODBC DSN to use Oracle driver from Microsoft (most windows installation has microsoft's odbc driver for oracle out of the box). 另外,您可以尝试使用ODBC .NET驱动程序,但是将ODBC DSN配置为使用Microsoft的Oracle驱动程序(大多数Windows安装都开箱即用了Microsoft的oracle odbc驱动程序)。 Again:
再次:
1) for 32bit application you need 32bit version of ODBC 1)对于32位应用程序,您需要32位版本的ODBC
2) oracle instant client should be available in the search path 2)oracle即时客户端应该在搜索路径中可用
In Windows 64bit there are two versions of ODBC admin panels for 32bit and 64bit applications. 在Windows 64位中,有两种版本的ODBC管理面板用于32位和64位应用程序。 To run 32b version execute C:\\Windows\\SysWOW64\\odbcad32.exe.
要运行32b版本,请执行C:\\ Windows \\ SysWOW64 \\ odbcad32.exe。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.