在C#应用程序中使用ODP.NET,托管驱动程序Beta(Oracle.ManagedDataAccess.dll)进行LDAP查找失败 [英] LDAP lookup using ODP.NET, Managed Driver Beta (Oracle.ManagedDataAccess.dll) fails in C# application

查看:428
本文介绍了在C#应用程序中使用ODP.NET,托管驱动程序Beta(Oracle.ManagedDataAccess.dll)进行LDAP查找失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 ODP.NET,托管驱动程序测试版(Oracle.ManagedDataAccess.dll)访问Oracle数据库.这是为了替换ODP.NET的本机版本,以便删除Oracle Client 10g/11g/etc上的所有本地依赖项.这样就不必在本地安装它.这是我在此处找到的解决方案.

I'm using ODP.NET, Managed Driver Beta (Oracle.ManagedDataAccess.dll) in my C# application to access an Oracle database. This is to replace using the native version of ODP.NET in order to remove all the local dependencies on Oracle Client 10g/11g/etc. so that this needn't have to be installed locally. This is a solution I found here.

这是我的C#代码:

new OracleConnection("Data Source=ABCDEFG1;User Id=myuserid;Password=mypassword;").Open();

已到达此行,并且成功创建了OracleConnection对象,从而表明所有依赖项均已成功加载.但是,它在对Open()的调用上引发 OracleException .错误消息是:

This line is reached and the OracleConnection object is created successfully thereby suggesting all dependencies are loaded successfully. However, it throws an OracleException on the call to Open(). The error message is:

网络传输:无法解析连接主机名

Network Transport: Unable to resolve connect hostname

我的组织使用LDAP执行主机名查找,这是通过使用DIRECTORY_SERVER设置的ORA文件完成的.但是,使用ODP.NET的托管版本很难做到这一点. ORA文件存储在C:\ Apps \ oracle \ network \ admin中.

My organisation performs hostname lookups using LDAP and this is done via the ORA files using DIRECTORY_SERVER setting. However, I'm having difficulty getting it to do this using the managed version of ODP.NET. The ORA files are stored in C:\Apps\oracle\network\admin.

tnsping正常.因此,我使用了tnsping的输出,并使用此输出在tnsnames.ora中为ABCDEFG1添加了一个条目.然后我的应用程序成功连接.因此,我知道它肯定是在查找和使用ORA文件,但是由于某种原因,它不会执行非托管ODP.NET(在其他应用程序中)使用的LDAP查找.

tnsping on my data source ('ABCDEFG1') works fine. So, I used the output of tnsping and added an entry for ABCDEFG1 in tnsnames.ora using this output. My application then connected successfully. So, I know that it is definitely finding and using the ORA files, but, for some reason, it won't perform the LDAP lookup that non-managed ODP.NET (in other applications) uses.

使用这个新的托管ODP.NET的人是否知道此问题或我可能做错了什么?

Is anyone who's used this new managed ODP.NET aware of this problem or what I might be doing wrong?

推荐答案

我问了相同的 answer .似乎托管的ODP.NET不支持LDAP,这在其

I asked the same question on the Oracle forums, and someone there came up with an answer. It appears that managed ODP.NET doesn’t support LDAP and this is in its release notes.

不过,我确实有一个其他问题,不过,如果有人可以通过回答进一步帮助我,我将很高兴代替那个.

I do have a further question following on from this, though, and would be happy if anyone could help me further by answering that one instead.

非常感谢.

这篇关于在C#应用程序中使用ODP.NET,托管驱动程序Beta(Oracle.ManagedDataAccess.dll)进行LDAP查找失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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