Johnson Bill

Johnson Bill

  • 1.7k
  • 63
  • 3.4k

Preventing an exception from happening when converting to bool

Oct 10 2022 1:34 PM

Hi,

Which is the best way to prevent this from throwing an exception, e.g. if it's null

(bool)(aDataTable.Rows[0]["aColumn"]))

Thanks


Answers (4)