Hello I have been able to prefetch related entities and is working ok but here is my problem:
I have a purchases DB where I have this structure
PERSON
|___SUPPLIER
|___PURCHASE_ORDER
|_PO_DETAIL
|___RECEPTION
| ____RECEPTION DETAILS
So I need for a report to get a table to be put in a grid where I have all the reception details, then load foreach detail some fields from Reception that is referenced to the Purchase Order, that is referenced to Supplier (supplier gets its name from a PERSONS table.
I created some custom properties like SupplierName in Supplier (from Person table), and so on, but how can I access a Field in PERSON table from RECEPTION DETAILS???
I am not sure if this is right
DataAccessAdapter adapter = new DataAccessAdapter();
IPrefetchPath2 prefetchPath = new PrefetchPath2((int)EntityType.ReceptionDetail);
prefetchPath.Add(ReceptionDetailEntity.PrefetchPathMaterials);
prefetchPath.Add(ReceptionEntity.PrefetchPathPurchaseOrderDetail).SubPath.Add(PuechaseOrderDetailEntity .PrefetchPathPuechaseOrder).SubPath.Add(PuechaseOrderEntity.PrefetchPathSupplier).SubPath.Add( SupplierEntity.PrefetchPathPerson);
adapter.FetchEntityCollection(_desempaqueDetalle, null,prefetchPath);
adapter.CloseConnection();
dataGridView1.DataSource = _desempaqueDetalleSrc;
This is working but how can I get a BIG TABLE where all the fields are joined ? I need to have in the Reception_Detail the name of the supplier that is in the PERSON table, is that possible??