How to write a .Net application that works with both SqlServer and Oracle (now that System.Data.OracleClient is deprecated)

前端 未结 13 741
礼貌的吻别
礼貌的吻别 2020-12-23 14:21

see also System.Data.OracleClient namespace discontinued?

(Firstly don’t panic yet, System.Data.OracleClient is not being removed by Microsoft yet, however it is not

13条回答
  •  再見小時候
    2020-12-23 14:56

    In my experience, you cannot simply deploy the ODP.NET data provider DLL. Oracle requires a Home installation for anything more than the default configuration (for instance, we use LDAP name resolution, requiring an LDAP.ora file in a special Home path).

    However, ODP.NET implements the ADO.NET 2.0 standards just fine (DbProviderFactory, etc). And I have programmed against the base classes (DbConnection, DbCommand, etc) without any need for the specific classes for some time at my company.

    My suggestion for making this data access work is to use/follow the guidance in the Entlib or use NHibernate.

    If you have a logistics or IT problem installing ODP.NET or getting it to your customer/client, I suggest you talk to your IT people and Oracle about solutions for that.

提交回复
热议问题