Handle NULL values when reading through OracleDataReader? Handle NULL values when reading through OracleDataReader? oracle oracle

Handle NULL values when reading through OracleDataReader?


yos.ServiceCredited = odr.IsDBNull(1) ? 0 : odr.GetDecimal(1);

OracleDataReader provides a IsDBNull() method.

And the docs on GetDecimal() ask us to do this

Call IsDBNull to check for null values before calling this method.