How to convert decmial?
type decmial?
in decimal
?
You should have what you like inrec.curPrice
if sdr.GetDecmial(7)
is null.
inrec.curPrice = sdr.GetDecimal(7) ?? 0M;
I suggested that you want to use 0 if the return value is null. If you do not change 0M
to some other decimal value.
--- Update after retry
What about inrec.curPrice = sdr.IsDBNull(7) ? 0M : sdr.GetDecimal(7);
inrec.curPrice = sdr.IsDBNull(7) ? 0M : sdr.GetDecimal(7);
?
source share