将System.Data.OracleClient替换为Oracle.DataAccess(ODP.NET) [英] Replacing System.Data.OracleClient to Oracle.DataAccess (ODP.NET)

查看:70
本文介绍了将System.Data.OracleClient替换为Oracle.DataAccess(ODP.NET)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在有一个正在使用System.Data.OracleClient的项目,并且由于不推荐使用,所以我想切换到Oracle 11g的ODP.NET最新版本.请让我知道以下步骤是否对我有用,或者需要采取某些其他措施才能使其正常工作:

I have a project which is using System.Data.OracleClient at the moment and since it is being deprecated so I want to switch to the ODP.NET latest version for Oracle 11g. Please let me know if the following steps would work for me or there are certain other actions required to get it working without any errors:

  • 删除对SYstem.Data.OracleClient的引用
  • 添加对Oracle.DataAccess dll的引用
  • 用OracleDbType替换OracleType枚举,并将对数据类型的引用从VarChar更新为Varchar2等.

推荐答案

您已经了解了很多.

这是我在执行此操作时遵循的Oracle文章: http://www.oracle.com/technetwork/topics/dotnet/code-154692.html

Here's the Oracle writeup I followed when doing this: http://www.oracle.com/technetwork/topics/dotnet/code-154692.html

还有两件事要做:

  1. 修复您的连接字符串.

  1. Fix your connection string.

使用OracleCommand.BindByName = true

建议:修复连接字符串后,通过将整个连接字符串放在程序中,摆脱对TNSNAMES.ORA的任何依赖.

Suggestion: When you fix your connection string, get rid of any dependence on TNSNAMES.ORA by putting the whole connection string right in your program.

这篇关于将System.Data.OracleClient替换为Oracle.DataAccess(ODP.NET)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆