Code Help - ConstraintException

Thank you @gpayne for your time and patience. I feel like a real heel :face_with_symbols_over_mouth: :face_with_symbols_over_mouth:

1 Like

I believe that this is why the invented the command documented here: C# string.IsNullOrEmpty, IsNullOrWhiteSpace - Dot Net Perls

you could change your line to the following and it would have worked in either case:

if (string.IsNullOrEmpty(prOpDtl.ResourceID == false)

or for simpler statement you could even add the exclamation at the beginning :

if (!string.IsNullOrEmpty(prOpDtl.ResourceID)
2 Likes

@jkane It was interesting learning. I came up with the below because I was getting (I thought) an error on the linq with !IsNullOrEmpty that works today. I have been working on routines similar to this for a few weeks and this exercise helped me understand the process better.

(JobOpDtl_Row.ResourceGrpID ?? "") != ""