Here is the code what I have tried:
if(!string.IsNullOrEmpty(Taskinfo.DoRollOver) &&(Taskinfo.DoRollOver != "YES" || Taskinfo.DoRollOver != "NO"))
{
throw new DataException("DoRollOver is not valid");
}
But if I try to give the valid data such as YES
or NO
still it throws an exception.
Aucun commentaire:
Enregistrer un commentaire