As you can see below if there is a BillAmt then there is nothing in the PaymentAmt Column. When I run the above code I get an error because there is no number in the PaymentAmt column.
I have a grid that displays the amt of a bill or a payment. If the user clicks on the checkbox I want to get the Total for the Bills and Payments. Here is how I have the grid laid out. If it is all messy I have attached a screen print to see.
I would like to add an IF Statement or something similar
if (BillAmt == ""){ BillAmt = 0;}OR in the SELECT portion change it to thisselect ISNULL(Convert.ToDecimal(Rows.Cells[AmountColumnName].Value), 0, Convert.ToDecimal(Rows.Cells[AmountColumnName].Value))