in

Problem getting an object's related objects through XXXObjectRecords function

Last post 05-06-2008 3:19 PM by jimmarq. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 05-06-2008 3:19 PM

    Problem getting an object's related objects through XXXObjectRecords function

    I have a Book table.  Each Book record can have many BookPage records.  I cannot access the records by using the book object's BookPageRecords function.  I get a TypeLoadException.  I can get the related objects by running a query, though.  It seems that the generated function BookPageRecords() is broken.  I'm using 2.1 beta 3 with VB generated code.

    'Works
    Dim coll As BookPageCollection = New BookPageCollection()
    Dim qry As SubSonic.Query = New SubSonic.Query(BookPage.Schema).WHERE("BookID", cb.BookID)
    coll.LoadAndCloseReader(qry.ExecuteReader())
    For Each bp As BookPage In coll
        Dim i As Integer = 0 'gets hear for each bookpage
    Next

    'broken
    For Each bp As BookPage In cb.Book.BookPageRecords
       Dim i As Integer = 0 'never gets here
    Next

Page 1 of 1 (1 items)