title: Oracle.DataAccess DataRow.Field<decimal> InvalidCastException
body: <p>In my code I was using <code>System.Data.OracleClient</code> for ora database connection. I would like to replace this library (because it is obsolete) with <code>Oracle.DataAccess</code>. Unfortunately I found that DataRow.Field() throws <code>InvalidCastException</code>. Same behavior is with <code>(decimal)x.Rows[0]["COLUME_NAME"]</code>. I do not have this issue with <code>System.Data.OracleClient</code>.</p>
  
  <p>Here is code example</p>
  
  <pre><code>using (var oracleConnection = new OracleConnection(connectionString))
  {
      using (var command = new OracleCommand("select * from tr", oracleConnection))
      {
          var result = new DataTable();
          var adapter = new OracleDataAdapter(command);
          adapter.Fill(result);
          Console.WriteLine(result.Rows[0].Field&lt;decimal&gt;("TR_SEQ_NUM"));
          //Console.WriteLine((decimal)result.Rows[0]["TR_SEQ_NUM"]);
      }
  }
  </code></pre>
  
  <p>TR_SEQ_NUM has <code>NUMBER(8,0)</code> datatype and full exception is:</p>
  
  <pre><code>System.InvalidCastException: Specified cast is not valid.
     at System.Data.DataRowExtensions.UnboxT`1.ValueField(Object value)
  </code></pre>
  
  <p>Code example working with <code>System.Data.OracleClient</code> but not with <code>Oracle.DataAccess</code></p>
  
  <p>I know that I can use <code>Convert.ChangeType</code> but I wonder if there is some way to have same behavior as with <code>System.Data.OracleClient</code>. Refactoring of all of my code will too much time expensive.</p>