EntityView to Datatable projection error

Posts   
 
    
yj
User
Posts: 39
Joined: 07-Aug-2007
# Posted on: 23-Aug-2007 03:56:11   

LLBLGen Pro 2 ASP.NET 2.0 with C#

Hi guys, i m using the sample code from the LLBL documentations, and made changes accordingly to the variable names, yet still i get the following error:

Argument '1': cannot convert from 'System.Collections.ArrayList' to 'System.Collections.Generic.List<SD.LLBLGen.Pro.ORMSupportClasses.IEntityPropertyProjector>'

Error 1 The best overloaded method match for 'SD.LLBLGen.Pro.ORMSupportClasses.EntityView<SBVS.EntityClasses.MHubDlpGroupEntity>. CreateProjection(System.Collections.Generic.List<SD.LLBLGen.Pro.ORMSupportClasses. IEntityPropertyProjector>, System.Data.DataTable)' has some invalid arguments

I had tried out using <List>IEntityPropertyProjector propertyProjectors = new IEntityPropertyProjector(); yet i get another error:

Error The type or namespace name 'List' could not be found (are you missing a using directive or an assembly reference?)

What am i actually missing?

the code i used are as below: // C# // fetch all managers ManagerCollection managers = new ManagerCollection(); managers.GetMulti(null); // now project them onto 2 new clerk entities, by just projecting the employee fields ArrayList propertyProjectors = new ArrayList(); propertyProjectors.Add( new EntityPropertyProjector( EmployeeFields.Id, "Id" ) ); propertyProjectors.Add( new EntityPropertyProjector( EmployeeFields.Name, "Name" ) ); propertyProjectors.Add( new EntityPropertyProjector( EmployeeFields.StartDate, "StartDate" ) ); propertyProjectors.Add( new EntityPropertyProjector( EmployeeFields.WorksForDepartmentId, "WorksForDepartmentId" ) ); ClerkCollection clerks = new ClerkCollection(); EntityView managersView = managers.DefaultView; // project data to transform all managers into clerks. wink managersView.CreateProjection( propertyProjectors, clerks );

Thank you all for the help.

Best regards, yjpan

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 23-Aug-2007 04:32:57   

Hi yjpan.

Please try this:[http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=9449&StartAtMessage=0&#52724](http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=9449&StartAtMessage=0&#52724)

David Elizondo | LLBLGen Support Team