IsDBNull

  • Thread starter Thread starter MeDhanush
  • Start date Start date
M

MeDhanush

Hi,
Can sb tell me is there any diff b/n

object == System.DBNull.Value and
Convert.IsDBNull( object )

TIA
Kishore
 
Hi,

The Convert.IsDBNull is implemented as a call to

if ( o == DBNull.Value )

If o is not DBNull it the function checks the type code of the value that it
is not TypeCode.DBNull if it is it returns true.
So Convert.IsDBNull is a more comprehensive test, however I believe that for
99.99% the test against DBNull.Value would suffice.

Hope this helps

Chris Taylor
 
Back
Top