title: Convert OracleParameter.Value to Int32
body: <p>I have a stored procedure call that goes like this:</p>
  
  <pre><code>using (OracleConnection con = new OracleConnection(ConfigurationManager.AppSettings["Database"]))
  using (OracleCommand cmd = new OracleCommand("Package.Procedure", con))
  {
     Int32 existsCount;
  
     cmd.CommandType = CommandType.StoredProcedure;
     cmd.Parameters.Add("successCount", OracleDbType.Int32, 0, ParameterDirection.InputOutput);
     cmd.Parameters.Add("BusinessId", OracleDbType.Int64, listRec.BusinessId, ParameterDirection.Input);
  
      con.Open();
      cmd.ExecuteScalar();
      con.Close();
  
      existsCount = Convert.ToInt32(cmd.Parameters["successCount"].Value);
  
      return (existsCount);
  }
  </code></pre>
  
  <p>But on this line:</p>
  
  <pre><code>existsCount = Convert.ToInt32(cmd.Parameters["successCount"].Value);
  </code></pre>
  
  <p>It throws the Exception "Unable to cast object of type 'Oracle.DataAccess.Types.OracleDecimal' to type 'System.IConvertible'."</p>
  
  <p>Any thoughts? Thanks.</p>