Hi
I am using LLBL v2.6, th adapter version.
I have 3 tables, Control, ControlItems and Items
One control can contain many items and items can belong to many controls.
The ControlItems table contains an order column which specifies the order the item will appear in a control, my problem is sorting my prefetched collection on this order value.
My code currently is
ControlEntity control = new ControlEntity(controlId);
IPrefetchPath2 prefetchPath = new PrefetchPath2((int)EntityType.ControlEntity);
prefetchPath.Add(ControlEntity.PrefetchPathItemCollectionViaControlItem);
using (DataAccessAdapter adapter = new DataAccessAdapter())
{
adapter.FetchEntity(control, prefetchPath);
}
I have tried adding
SortExpression sorter = new SortExpression(ControlItemFields.Order | SortOperator.Ascending);
to the prefect path like so
prefetchPath.Add(prefetchPath.AddControlEntity.PrefetchPathItemCollectionViaControlItem,0,null,null,sorter);
but I get an error
The multi-part identifier "dbo.ControlItem.order" could not be bound
I understand why I am getting the error, but I don't understand how I get round it?
What is the best way of achieving what I am trying to do?
Thanks
Bannis