TObjectList from dataset

Home Forums kbmMW TObjectList from dataset

This topic contains 1 reply, has 2 voices, and was last updated by  kimbomadsen 2 months, 3 weeks ago.

  • Author
    Posts
  • #53909

    mrluigi2017
    Participant

    Hi,

    I would like to build a TObjectList<TSomeObject>  from a dataset. I use the following code but it doesn’t work.

    SomeObjectList := ORM.FromDataSet<TObjectList<TSomeObject>>(qSomeQuery);

    I do not get an exception and when I debug and step in it just jumps to some assembly. Am I using the right syntax here?  Could this problem be caused by the register knownclasses issue? I have added a reference like Fransisco suggested.  When I just use the orm without the dataset it works fine!

     

    Any suggestions…

     

    Thanks in advance!

    Luigi

    • This topic was modified 2 months, 3 weeks ago by  mrluigi2017.
  • #53911

    kimbomadsen
    Keymaster

    Hi,

    Use someobjectlist:=ORM. ListFromDataset<TSomeObject>(qSomeQuery)

    where someobjectlist:TObjectList<TSomeObject>;

    TSomeObject needs to be registered and known.

You must be logged in to reply to this topic.