C
Chris
Hello:
I understand that the DataRow object offers .IsNull(), however once
the object has been retrieved from the row is it enough to just check
for DBNull or should I also check for null? As such:
// Begin C# ADO.NET Code
DataRow dr = GetDataRowFromSomeSource();
Object o = dr[ "existing_column" ];
if ( o is DBNull )
doNullAction();
else if ( o == null )
doNullAction();
// End C# ADO.NET Code
According to what I've read, only this should be necessary:
// Begin C# ADO.NET Code
DataRow dr = GetDataRowFromSomeSource();
Object o = dr[ "existing_column" ];
if ( o is DBNull )
doNullAction();
// No check for null here
// End C# ADO.NET Code
Correct?
I understand that the DataRow object offers .IsNull(), however once
the object has been retrieved from the row is it enough to just check
for DBNull or should I also check for null? As such:
// Begin C# ADO.NET Code
DataRow dr = GetDataRowFromSomeSource();
Object o = dr[ "existing_column" ];
if ( o is DBNull )
doNullAction();
else if ( o == null )
doNullAction();
// End C# ADO.NET Code
According to what I've read, only this should be necessary:
// Begin C# ADO.NET Code
DataRow dr = GetDataRowFromSomeSource();
Object o = dr[ "existing_column" ];
if ( o is DBNull )
doNullAction();
// No check for null here
// End C# ADO.NET Code
Correct?