2

I'm converting a product from System.Data.OracleClient to Oracle.DataAccess.Client, and came across a question Here's a snippet of some code:

try
{
    //some db code
}
catch (System.Data.OracleClient.OracleException ex)
{
    if (ex.Code == 00904)
    {
        // log specific error
    }
}

The problem is, Oracle.DataAccess.Client.OracleException has no Code property. It has a Number property. Is this the same thing? The docs say this about the property -

This error number can be the topmost level of error generated by Oracle and can be a provider-specific error number.

The Code property contained the ORA- error code.

1 Answer 1

2

Yes, they are the same thing. Oracle.DataAccess.Client.OracleException.Number is the same info as System.Data.OracleClient.OracleException.Code.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.