I'm not sure what exactly is happening. After posting the message I looked at the problem a little closer, and it appears the memento code is working as designed. However, sometimes when I set a value in a field that was originally null and try to save the record, the value does not get posted to the database, and if I don't change any other values, the save code doesn't even execute. I will look into the issue a little more when I get a chance.
Dan
<i><font color="#663300"> <i><font color="#663300">Has there been a fix to the Memento class so fields that are changed from null to a value are saved? Currently, if a person puts a value in the field that is originally null, the record does not save.</font></i>
Where does it fail? Are you sure that the Memento's is not correctly setting its lIsChanged property when CompareState() is called? I just reviewed the code, and it seems that if the original value is null and the new value is not null, it will be marked as changed. </font></i>
Dan Welter MCSD ©2002 Dan Welter |