Search   

Sunday, February 05, 2012

Support » Support Forum

Register  Login

 Menu  
 
    

 Welcome!  
 


Welcome to the NDO support forum!

kreis.gif Please register/login at the site if you want to post a thread. We sometimes copy support mails of common interest to the forum. They appear with anonymous sender.
kreis.gif Please post your messages in English language if possible. You can do your posts also in German, we will translate your post and our answer so that all users of the forum can read your posts.
kreis.gif The forum software requires that javascript is enabled.
kreis.gif Please do not insert licence information or licence keys in forum posts.
kreis.gif If you know a good answer to a post of another user, feel free to reply!
kreis.gif The forum is monitored. We reserve the right to remove posts we consider not to be useful for other forum users.

   Print   

      
 NDO Support Forum  
 
SearchForum Home
  NDO-Forum postings in english please, if possible.  Developing with NDO  Error on adding...
 Error on adding object trough relation
 
 1/8/2007 8:21:08 AM
didikunz
9 posts
www.mediasupport.ch


Error on adding object trough relation
Hi,

I have an error: 'Can only add persistent objects in Assoziation DataObjects.Projects >DataObjects.Classes.' on the line _Classes.Add(c) in the following by 'Add Accessor' build function:

Public Function NewClasses() As Classes
Dim c As Classes = New Classes
_Classes.Add(c)
Return c
End Function

The call originates from this:

Dim cls As Classes = currProj.NewClasses
cls.Name = "New Class"
pm.Save()

Any idea

Regards: Didi
 1/8/2007 1:19:47 PM
mig
9 posts


Re: Error on adding object trough relation
Hi didi, try to use MakePersistent() on your new object. Otherwise the persistence manager will not know your object. Greetings, michael
 1/10/2007 6:44:25 AM
didikunz
9 posts
www.mediasupport.ch


Re: Error on adding object trough relation
Hi mig,

I know that, but why does the 'add accessor' create such a method, and the doc tells to use it?

Didi
 1/10/2007 8:39:45 AM
didikunz
9 posts
www.mediasupport.ch


Re: Error on adding object trough relation
Hello Michael,

I found the error: the relation was of type 'Default' instead of 'Composite'
Thank you anyway. Didi.
 1/15/2007 6:53:19 PM
Mirko
109 posts
5th


Re: Error on adding object trough relation

Hi Didi

normally the NDO AddAccessor functionality adds a factory method NewXxx, if your relation is a composite. If your relation is an assoziation, NDO adds a AddXxx method.

Regards:
Mirko

  NDO-Forum postings in english please, if possible.  Developing with NDO  Error on adding...
  SearchSearch  Forum HomeForum Home