I have a few fields that I'm reading from an excel file that could be blank (null) or with values (int or decimal).
Below is the code I've written, but it seemed like the conditional statement would not work as there is a type mismatch between the true/false statement. Is there a way to convert to a nullable type in the false statement?
Thanks in advance.
decimal? paid = dReader["PAID_" + dynColsSuffix] == null ? null : Convert.ToDecimal(dReader["PAID_" + dynColsSuffix]);