Object calling update instead of insert

Object calling update instead of insert

Old forum URL: forums.lhotka.net/forums/t/6436.aspx


James Thomas posted on Tuesday, February 17, 2009

Hi All,
I have a strange bug in my silverlight application. It's based on the Rolodex code and has several similar BusinessBase objects that all follow the same basic template. The strange thing is, that when I hit 'save' on a new object for one of them, DataPortal_Update() is called, rather than DataPortal_Insert(). Do you know what I've done wrong? I can't see what I'm doing differently for this object.
Thanks, James.

triplea replied on Tuesday, February 17, 2009

How did you create the object in the first place? Calling DataPortal.Create, private constructor or fetch an entry from the database? Depending on your scenario, you might need to call MarkNew but some more info would be helpful...

James Thomas replied on Tuesday, February 17, 2009

Thanks for your response triplea. I've just tracked the problem down - it was due to me 'chaining' dataprovider events, due to problems with the Silverlight ComboBox (see this thread http://forums.lhotka.net/forums/thread/31034.aspx) and overwriting my new object with an empty one.

Copyright (c) Marimer LLC