title: Catching ODP.NET exception using error codes
body: <p>I am working on an application which uses <code>SqlBulkCopy</code> and <code>OracleBulkCopy</code>. Sometimes when I try to insert some records and the records already exist on SQL Server, it throws an exception which I catch like below, and I handle it in a way.</p>
  
  <pre><code> Catch ex As SqlException When ex.ErrorCode = -2146232060 
  </code></pre>
  
  <p>However, I am not sure how to catch the exception on OracleBulkCopy which comes with error code: <code>ORA-26026</code>.</p>
  
  <p>This is the structure I'm trying to use:</p>
  
  <pre><code>        Try
              'code
          Catch ex As SqlException When ex.ErrorCode = -2146232060
              'Handle SQL
          Catch ex As OracleException When ex.Number = 26026
              'Handle Oracle
          Catch ex As Exception
              'Handle General errors
          End Try
  </code></pre>
  
  <p>Is there a way?</p>