Why does SqlDecimal.Null apply only to SqlMoney?

  • Thread starter Thread starter Mike Bridge
  • Start date Start date
M

Mike Bridge

According to MSDN, the SqlDecimal.Null is applicable to the SqlMoney
class:

"Represents a null value that can be assigned to the Value property of
an instance of the SqlMoney class."

Why wouldn't you use the SqlMoney.Null value for SqlMoney? I realize
that I can use System.DBNull instead, but this seems like a bug to me.

I'm getting and setting these values through reflection---and I'm just
wondering why SqlDecimal seems to be a special case that I have to
test for.

-Mike
 
SqlMoney, by technicality is SqlDecimal. I am not sure why they did not make
a SqlMoney.Null, as well, but I could always ask next time I am in Redmond.
;->

For the most part, MS has depricated Money and suggests against its use.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************************************************
Think outside the box!
***************************************************************
 
I'm certain that this must be a bug---the Sql Type wrapper classes are
intended to wrap discrete values in the database, but as far as I can
tell, it is impossible wrap a Null in a Decimal field with the proper
wrapper. I *can* create one with System.DBNull, but this defeats the
purpose of having a wrapper.

Pass on my bug report while you're there! :)

-Mike
 
Back
Top