Johnson Bill

Johnson Bill

  • 1.6k
  • 62
  • 3k

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)