Error in Retrieving List colliection

Error in Retrieving List colliection

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


beach17 posted on Thursday, July 17, 2008

Has any one seen this error and can tell me the cause of the error and how to get over the problem. I am new to CSLA and might not be explaining the situation in the best way, but here is my attempt to explain the scenario

I have 3 levels of hierarchy GranParent class, Parent, Class and Child class.

GrandParent, Parent and Child have list classes to display collections of these classes, all the collections are editable in the sense that I will need to add or remove members to the collections

GranParent manages ParentList

and ParentList manages ChildList

In the parent Class I attempt to obtain  the collection of Child called  ChildList

Public Class Parent

Inherits  BuisnessBase(of Parent)

 

 

# Region " Data Access"

-----------------------

--------------------------

This Call at this location in the Parent Class

 

 

In the  Data access region of the Parent class  when I attempt to get  ChildList with the line of code immediately  below :-

 

LoadProperty(Of ChildList)(SubOwnersProperty, _

ChildList.GetChildList(data.ChildList.ToArray))

I get his error

DataPortal.Getch Failed Csla.DataPortalException ChildDataPortal.Fetch Failed on the server System.array Type mismatch sorce array type cannot be assigned to destination array type  that is generated within CSLA  by Function Fetch in the class ChildatPortal.vb--------

 

--------------

---------------

# End Region

End Class

 

The ChildList Class is defined as

Public Class  ChildList

Inherits ReadOnlyListBase(Of ChildListList,  Parent)

-----------------------

---------------------

----------------------

Public Shared Function GetChildList(ByVal name As String) As ChildrList

Return DataPortal.Fetch(Of ChildList)(New SingleCriteria(Of ChildrList, String)(name))

End Function

-------------------

 

------------

End Class

 Thanks

RockfordLhotka replied on Thursday, July 17, 2008

Wait, are you saying this:

ChildList.GetChildList(data.ChildList.ToArray))

is calling this:

Public Shared Function GetChildList(ByVal name As String) As ChildrList

You are passing an array to a method that expects a simple string? That shouldn't even compile, much less run.

Copyright (c) Marimer LLC