Read numeric data from oracle table in c#
<p>I am trying to write c# function to read some data from oracle table</p>

<p>My functions:</p>

<pre><code>public static writeConsole(string query, string connectionString, string driver)
{
    //driver = Oracle.ManagedDataAccess.Client
    using (var conn = DbProviderFactories.GetFactory(driver).CreateConnection())
    {
        using (var cmd = conn.CreateCommand())
        {
            cmd.Connection.ConnectionString = connectionString;
            cmd.CommandType = CommandType.Text;
            cmd.CommandText = query;

            foreach (var item in ReadDouble(cmd))
            {
                Console.WriteLine(item);
            }
        }
    }
}
private static IEnumerable&lt;double&gt; ReadDouble(IDbCommand cmd)
{
    using (var r = cmd.ExecuteReader())
    {
        while (r.Read())
            yield return r.GetDouble(0);
    }
}
</code></pre>

<p>There is no problem in connection, nor executing query.</p>

<p>When I read data from oracle table in type number(9) it returns proper values I am expecting. </p>

<p>When I read data from table, where type is number(9,2) it returns empty value (like empty table).</p>

<p>Notice: This is only sample of the code. It has to be written using IDb interfaces</p>

<p>Thank you for help</p>