If you are using a Command for the sql you could do it using 'exists'
Something like
select order_id, order_line fields from orders O join order_lines OL
on order_id (or whatever)
where exists (select 1 from order_lines OL1 where code = '49-003'
and OL1.order_id = O.order_id)
I'm doing this off the top of my head, that is probably not the right syntax but it might give you the idea.