When insert empty value from GridView to database error is coming.
Object reference not set to an instance of an object.
ataTable dt = (DataTable)ViewState["dt"];
int codeitem, orderqty;
string ditem;
decimal i_rate;
foreach (DataRow row in dt.Rows)
{
orderqty = int.Parse(row["orderqty"].ToString());
codeitem = int.Parse(row["Codeitem"].ToString());
ditem = (row["D_Item"].ToString());
i_rate = decimal.Parse(row["Item_Rate"].ToString());
this.InsertRows(codeitem, orderqty, ditem, i_rate);
}
on below line
i_rate = decimal.Parse(row["Item_Rate"].ToString());