J
John A Grandy
I would like to pass a DataRow column value to a method that accepts an
object parameter :
MyMethod( object value ) {}
However, a problem occurs if the column value is DBNull.Value
MyMethod( DataRow["MyCol"] );
A null reference exception is thrown in this case.
What is the reason that a DBNull.Value can't be passed as a parameter of
type object ?
object parameter :
MyMethod( object value ) {}
However, a problem occurs if the column value is DBNull.Value
MyMethod( DataRow["MyCol"] );
A null reference exception is thrown in this case.
What is the reason that a DBNull.Value can't be passed as a parameter of
type object ?