日期:2014-05-17  浏览次数:20766 次

32位C#程序 连接64位ORACLE数据库
VS2008 生成32位程序,安装在64位服务器上,调用System.data.oracleclient
  oracleConn = new OracleConnection();
  oracleConn.ConnectionString = sqlDbConnectionString;
  try
  {
  oracleConn.Open(); //粗步估计是此出错
  }
  catch (Exception ex)
  {
  MessageBox.Show(ex.ToString());
  }
出错信息:System.InvalidOperationException: Attempt to load Oracle client libraries threw BadImageFormatException. This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed.

求解决方案。



------解决方案--------------------
生成anycpu版本啊
------解决方案--------------------
探讨

生成anycpu版本啊

------解决方案--------------------
那不一定是这个问题 你应该首先检查防火墙是否开启 ,其他软件是否正常连接 等等
------解决方案--------------------
64位电脑上安装64位的Oracle客户端。
------解决方案--------------------
装个补丁就好了