How to use CreateHierarchicalProjection to have more than one DataTable

Posts   
 
    
Wally
User
Posts: 285
Joined: 29-Aug-2007
# Posted on: 28-Feb-2008 23:13:08   

Hello,

I'm not able to find how to use "CreateHierarchicalProjection" to get more than one DataTable.

I tried prefetchpath without succes.

Does anybody has a simple code example that does that (just the main few lines) ???

Thanks, Eric

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

There is a Projection to DataSet example in the manual.

Please check Hierarchical projections of entity collections at the following manual's path: Using the generated code -> Adapter/SelfServicing -> Using the entity collection classes

Wally
User
Posts: 285
Joined: 29-Aug-2007
# Posted on: 29-Feb-2008 14:40:04   

Thanks a lot Walaa !

I already found the page and red it but it's the first time I realise that there is hidden samples behind the gray bar. (It would be helpfull :-))

Wally
User
Posts: 285
Joined: 29-Aug-2007
# Posted on: 29-Feb-2008 14:54:44   

Can you help me,

Its not completely clear how to use projection. I have relation 1->m on : TopologieDetail(1) -> TopologiePoint(m) I try to get a dataset with both entity type with the relation.

Isaw the example but I'm having hard time to understand it. I try that without success the following code. If you have a minute, are you able to tell me what's wrong in it ??? (I only get records for the TopologiePoint entity)

DataSet dataTopoPoint = new DataSet();

TopologiePointCollection topos = new TopologiePointCollection(); topos.GetMulti(new PredicateExpression(TopologiePointFields.TopologieId == topologieId), new PrefetchPath(EntityType.TopologieDetailEntity));

topos.CreateHierarchicalProjection(dataTopoPoint);

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 29-Feb-2008 15:30:34   

DataSet dataTopoPoint = new DataSet();

TopologiePointCollection topos = new TopologiePointCollection(); topos.GetMulti(new PredicateExpression(TopologiePointFields.TopologieId == topologieId), new PrefetchPath(EntityType.TopologieDetailEntity));

topos.CreateHierarchicalProjection(dataTopoPoint);

Your prefetchPath specification is not correct. please try the following:

PrefetchPath path = new PrefetchPath(EntityType.TopologiePointEntity);
path.Add(TopologiePointEntity.PrefetchPathTopologieDetails);

TopologiePointCollection topos = new TopologiePointCollection();
topos.GetMulti(new PredicateExpression(TopologiePointFields.TopologieId == topologieId), path);
Posts: 22
Joined: 07-Sep-2007
# Posted on: 08-Mar-2008 17:06:03   

Thanks a lot,

I'm sure it's the way to do it. I was in holliday last week (and now)... I haven't test but I should do it on next monday or thuesday.

Thanks Éric