Insert child object

Insert child object

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


R_Raccoon posted on Thursday, January 18, 2007

In the VB2005 book, an example is shown of the Project object's Dataportal_Insert method calling the child collection update method (mResources.Update(Me).  I assume this is to update a child object added at the time of root object's insertion. 

However, in the example, this is not done (the child objects are only added after the Project object has been added and reloaded so this code is not applicable in the DataPortal_Insert method.

Am I wrong, and if not, how do I make it work correctly so I can save child objects at the same time I save root objects?

Thanks in advance for your help.

 

 

Jimbo replied on Thursday, January 18, 2007

Do more than read the book.  Build and run ProjectTracker and you will see.

RockfordLhotka replied on Thursday, January 18, 2007

You may want to look at the Resource object and its children. I chose to do Project one way, and Resource a different way to illustrate different techniques you can use to insert/update/delete your data.

Copyright (c) Marimer LLC