I have below code. I have null value in itemrate(Rate), so how it will be handle.
C#
Code
DataTable dt = (DataTable)ViewState["dt"];
int codeitem, orderqty;
decimal itemrate;
foreach (DataRow row in dt.Rows)
{
orderqty = int.Parse(row["orderqty"].ToString());
codeitem = int.Parse(row["Codeitem"].ToString());
itemrate = decimal.Parse(row["Rate"].ToString());
this.InsertRows(codeitem, orderqty, itemrate);
}
Input string was not in a correct format.
itemrate = decimal.Parse(row["Rate"].ToString());