Tag: oracleclient

如何在没有公共构造函数的情况下模拟/伪造/存根密封OracleException?

在我的测试中,我需要测试抛出OracleException时会发生什么(由于存储过程失败)。 我正在尝试设置Rhino Mocks Expect.Call(….).Throw(new OracleException()); 无论出于何种原因,OracleException似乎都没有公共构造函数。 我该怎么做才能测试这个? 编辑:这正是我想要实例化的内容: public sealed class OracleException : DbException { private OracleException(string message, int code) { …} }

与Oracle的连接通过控制台应用程序工作,不能通过Web服务工作

我无法通过asmx Web服务连接到Oracle模式,而不是通过控制台应用程序[x86]。 代码: var conn = new OracleConnection(“Data Source=xe;User ID=mySchema;Password=myPass”); 例外: ORA-12154: TNS:could not resolve the connect identifier specified 环境:Windows 7 x64 – VS 2008。 任何的想法? 请您提供任何额外信息 提前致谢。