sdr is my sqldatareader and I want to check that the curPrice value which is of type decimal is null.
inrec.curPrice = sdr.IsDBNull(7) ? (decimal?)null : sdr.
How about converting the decmial? type to decimal ?
You have to have what value you like inrec.curPrice to have when sdr.GetDecmial(7) is null.
inrec.curPrice = sdr.GetDecimal(7) ?? 0M;
I assumed that you would want to use 0 if what's returned was null. If not change 0M to some other decimal value.
--- Update after replay
How about inrec.curPrice = sdr.IsDBNull(7) ? 0M : sdr.GetDecimal(7); ?