BusinessListBase DataPortal_OnDataPortalException identify which child cause error?

BusinessListBase DataPortal_OnDataPortalException identify which child cause error?

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


kids_pro posted on Wednesday, August 02, 2006

If it possible to detect which child object cause error while I use parent in the following situation:

/* import data */
Parents parent = Parents.NewParents()
parent.BeginEdit();

for(int i = 0; i < 100; i++){
    /* keep add child, read data from Access -> SqlServer */
    ...
}

parent.ApplyEdit();
parent.Save(); /* error throw here how do I know which child cause trouble? */



ajj3085 replied on Thursday, August 03, 2006

You can catch the error, and than loop through the children collection checking each childs IsValid property.

Copyright (c) Marimer LLC