if(((TextBox)GridView1.Rows[i].FindControl("txtUnit")).Text == null ||((TextBox)GridView1.Rows[i].FindControl("txtUnit")).Text == "")
{
string Val = "0";
cmdInvDtls.Parameters.Add("@Units", SqlDbType.Int).Value = int.Parse(Val);
}
on cmdInvDtls.ExecuteNonQuery() the above errors generates