Ahh i see "0" is a special case. Why can't "0" be a valid id?
>Hi Einar,
>
>This would take care of the case of null, but what about "0" ? Looks like I have to use or condition, that's how I tried to code it last night.
>
>>try changing
>>
>>((e.NewValues["FatherID"]?? "0") =="0")
>>
>>to
>>
>>e.NewValues["FatherID"]==null?true:false
>>
>>
>>>Hi everybody,
>>>
>>>I could not understand why
>>>
>>> if ((e.NewValues["FatherID"]?? "0") =="0" && e.NewValues["Father"] != string.Empty)
>>>
>>>evaluates to false
>>>
>>>when
>>>
>>>e.NewValues["FatherID"]?? "0") shows "0" in the watch window and
>>>e.NewValues["Father"] = "Some value"
>>>
>>>But checking
>>>
>>>((e.NewValues["FatherID"]?? "0") =="0") also produces false.
>>>
>>>Do you see where is my logic mistake here?
>>>
>>>I want to do some special coding if ID is 0 or null and Name is not empty.
>>>
>>>Thanks in advance.
Semper ubi sub ubi.