I am putting SQL values inside <td> and this line below it's causing a format error, i don't know if the parsing is incorrect or missing something. Please help
litAccordionFooter.Text += "<td style='width: 12.2%;font-weight: bold;'>"
+ string.Format("{0:C}", (((ds.Tables[1].Rows[0]["TOTAL_AMT"]))
== DBNull.Value ? 1
: decimal.Parse((ds.Tables[1].Rows[0]["TOTAL_AMT"]).ToString()))
/ ((int.Parse((ds.Tables[1].Rows[0]["TOTAL_QTY"]).ToString())) == 0
|| ds.Tables[1].Rows[0]["TOTAL_QTY"] == DBNull.Value ? 1
: (int.Parse((ds.Tables[1].Rows[0]["TOTAL_QTY"]).ToString())))) + "</td>";