This error will raise while the passing parameters with NULL values, we can handle this exception
if(LoanRefNo!=null)
{
parameters.Add("@lRefNo", SqlDbType.NVarChar, LoanRefNo, 50);
}
else{
parameters.Add("@lRefNo", SqlDbType.NVarChar,
DBNull.Value
, 50);
}