I have a GridView which I want to filled with data from 2 tables from a database. The scenario is like this:
- I have a LINQ QUERY(QUERY1) that gets data(COL1,COL2,COL3) from TABLE1 if COND1 is fulfilled.
- with the results from QUERY1 I want to get data from TABLE2
- I have QUERY2 on TABLE2 like this if (COL1(QUERY1) == value and COL2(QUERY) == value) return something as COL4. For each row returned by QUERY1 is made QUERY2 request. If QUERY2 returns a row I want to have a structure like this:
COL1(Data) COL2(Data) COL3(Data) YES
If QUERY2 return 0 rows I want to have in the same structure
COL1(Data) COL2(Data) COL(Data)3 NO
So the IQueryable structure could look like this:
COL1 COL2 COL3 COL4 val1 val2 val3 NO val1 val2 val3 YES val1 val2 val3 NO ....
It's possible to do this with a LINQ command ?