Sorry for such simple question.
How would I check this for nulls?
obj.DivisionNotes = (string)row["DivisionNotes"];
I'm thinking something like this.
obj.DivisionNotes = (string)row["DivisionNotes"]?null:"No notes";
Am I right.
Any help much appreciated.
Your casting of a null will cause a problem, you can use an as cast along with the null coalescing operator to solve your issues..
obj.DivisionNotes = (row["DivisionNotes"] as string) ?? "No notes";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With