c# getdecimal null code example Example: c# getdecimal null decimal? d= myRdr["myValue"] == DBNull.Value ? null : (decimal?)myRdr["myValue"];