unable to create a datable thru etnityview projection....

Posts   
 
    
nilsey
User
Posts: 54
Joined: 11-Jan-2008
# Posted on: 13-Feb-2008 01:07:58   

Here's my code:

        Dim user As UserEntity = New UserEntity(Me.UserId)
        Dim orgs As OrganizationCollection = user.GetMultiOrgsAssigned(False)

        Dim orgsview As EntityView(Of OrganizationEntity)
        orgsview = orgs.DefaultView
        Dim propertyProjectors As New List(Of EntityPropertyProjector)

        propertyProjectors.Add(New EntityPropertyProjector(OrganizationFields.Id, "Id"))
        propertyProjectors.Add(New EntityPropertyProjector(OrganizationFields.Name, "HCO"))

        Dim projectionResults As New DataTable()
        ' create the actual projection.
        Response.Write("made to the projection")
        orgsview.CreateProjection(propertyProjectors, projectionResults)

and i get the following error on compile:

error BC30518: Overload resolution failed because no accessible 'CreateProjection' can be called with these arguments:
'Public Sub CreateProjection(propertyProjectors As System.Collections.Generic.List(Of SD.LLBLGen.Pro.ORMSupportClasses.IEntityPropertyProjector), projector As SD.LLBLGen.Pro.ORMSupportClasses.IEntityDataProjector)': Value of type 'System.Collections.Generic.List(Of SD.LLBLGen.Pro.ORMSupportClasses.EntityPropertyProjector)' cannot be converted to 'System.Collections.Generic.List(Of SD.LLBLGen.Pro.ORMSupportClasses.IEntityPropertyProjector)'.
    'Public Sub CreateProjection(propertyProjectors As System.Collections.Generic.List(Of SD.LLBLGen.Pro.ORMSupportClasses.IEntityPropertyProjector), destination As SD.LLBLGen.Pro.ORMSupportClasses.IEntityCollection)': Value of type 'System.Collections.Generic.List(Of SD.LLBLGen.Pro.ORMSupportClasses.EntityPropertyProjector)' cannot be converted to 'System.Collections.Generic.List(Of SD.LLBLGen.Pro.ORMSupportClasses.IEntityPropertyProjector)'.
    'Public Sub CreateProjection(propertyProjectors As System.Collections.Generic.List(Of SD.LLBLGen.Pro.ORMSupportClasses.IEntityPropertyProjector), destination As System.Data.DataTable)': Value of type 'System.Collections.Generic.List(Of SD.LLBLGen.Pro.ORMSupportClasses.EntityPropertyProjector)' cannot be converted to 'System.Collections.Generic.List(Of SD.LLBLGen.Pro.ORMSupportClasses.IEntityPropertyProjector)'.

any ideas?

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 13-Feb-2008 09:42:20   

Instead of: Dim propertyProjectors As New List(Of EntityPropertyProjector)

Use: Dim propertyProjectors As New ArrayList()

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 13-Feb-2008 11:38:56   

Or cast to IList first. I must say... it's a problem in the VB.NET compiler. This problem plagued the .NET 1.x compiler of VB.NET much more than the .net 2.0 compiler but it's still there. The C# compiler has no problem picking the right overload and neither should the vb.net compiler.

Frans Bouma | Lead developer LLBLGen Pro