Anthony wrote:
How would i implement in code a query like :
SELECT CallId, Call FROM tblcalls WHERE CallId in (SELECT CallId from tblcallActivity where ActivityTypeId=A)
A= integer
Is the best way? How do i do this in code?
Using llblgen v2.5,dotnet2,adapter
I assume you want a collection of call entities and not a dynamic list (dataset)?
I also assume your SQL can be rewritten as:
SELECT DISTINCT
CallId, Call
FROM
tblCalls c
INNER JOIN tblCallActivity a ON a.CallId = c.CallId
WHERE
a.ActivityTypeId = A
If the above assumptions are true, you want to do an EntityCollection Fetch of tblCalls. You will want to create a RelationPredicateBucket, with a relation from tblCalls to tblCallActivity and a predicate expression of "tblCallActivity.ActivityTypeId = A".
If you want a dymanic list/dataset, the steps are very similar, except you will need to create a field collection (callId and Call) and use adapter.FetchTypedList.
HTH,
Phil