Connection to Oracle works through a console application and doesn't work through a web service

为君一笑 提交于 2019-12-05 20:54:16

OCI, the Oracle client layer on which ODP (or the native Oracle client layer) is based has a bug that prevents any application located in a folder containing parentheses () from running properly

This bug is very visible since the apparition of the Program Files (x86) folder...

The host running your application (typically IIS) is probably located in the x86 folder, hence the issue. Your console app works fine because it's probably located in a folder that does not have the issue.

More info and a few solutions here.

I'm not an Oracle guy in any way but I've run into similar situations in other databases. The problem we had was that the DSN was created as a User DSN and not a System DSN. I don't know how Oracle data sources are created but I would check this out.

I got the exact same issue. I resolved by referencing Oracle.ManagedDataAccess.dll instead of Oracle.DataAccess.dll.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!