The code in my GetCollection shared method is trivial - I added the Try/Catch just to catch the problem at the source:
Private Sub Fetch(ByVal dr As SafeDataReader) ' create a child object for each row in the data source, this guy is only ' called by his own Shared Method - so Private works fine While dr.Read Try List.Add(RenewalNotice.GetRenewalNotice(dr)) Catch ex As Exception MsgBox(ex.ToString) End Try End While End SubEvery time List.Add() is called the following error msg is generated (it is line 162):
System.Exception: Parent value can only be set for child objects
at CSLA.BusinessBase.SetParent(BusinessCollectionBase parent) in C:\Visual Studio Projects\CSLA_1_52\Csla10\CSLA\BusinessBase.vb:line 239
at CSLA.BusinessCollectionBase.OnInsert(Int32 index, Object value) in C:\Visual Studio Projects\CSLA_1_52\Csla10\CSLA\BusinessCollectionBase.vb:line 425
at System.Collections.CollectionBase.System.Collections.IList.Add(Object value)
at TagTrackerLibrary.RenewalNoticeCollection.Fetch(SafeDataReader dr) in C:\Visual Studio Projects\TagTracker\TagTrackerLibrary\RenewalNoticeCollection.vb:line 162
What am I doing wrong here?
Thanks,
Bless you! Bless you!
I actually looked at that possibility on the collection class, but not on the child class.
The really alarming thing here for me is that this is generated code. I made a template six or eight months from which this one is a descendant and I can't figure out where I've screwed it up. But I better be very careful about re-generating any of my recent projects until I do a little research, eh?
Thanks so very much.
Copyright (c) Marimer LLC