Which of IsDBNull and IsNull should be used?

后端 未结 7 1974
傲寒
傲寒 2021-01-07 23:02

If in VB.NET I have DataRow and I want to test whether a column value is Null, should I use:

myDataRow.IsNull(\"Column         


        
相关标签:
7条回答
  • 2021-01-07 23:38

    I did bit of findings and found interesting facts which provides more insight on usage of DataRow.IsNull OR IsDBNull.

    DataRow.IsNull - Gets a value that indicates whether the specified DataColumn contains a null value. Convert.IsDBNull - Returns an indication whether the specified object is of type DBNull.

    References: DataRow.IsNull and IsDBNull

    The most interesting discussion which provides clear conclusion can be drawn from Performance Consideration

    Nearly similar discussion were done earlier, here are references:

    Finding null value in dataset datarow isnull...

    Most efficient way to check for dbnull...

    Avoid checking for datarow isdbnull...

    0 讨论(0)
提交回复
热议问题