I can\'t understand why this won\'t work
decimal? compRetAmount = !string.IsNullOrEmpty(txtLineCompRetAmt.Text) ? decimal.Parse(txtLineCompRetAmt.Text.R
Try this:
decimal? compRetAmount = !string.IsNullOrEmpty(txtLineCompRetAmt.Text) ? decimal.Parse(txtLineCompRetAmt.Text.Replace(",", "")) : (decimal?) null;
The problem is that the compiler does not know what type nullhas. So you can just cast it to decimal?
null
decimal?