Take the 2-minute tour ×

In SQL I have :

 SELECT gu.*, cu.*
 FROM [gene_genunit] as gu, [cont_unitati] as cu

I have a WPF application.

share|improve this question

2 Answers 2

the LINQ equivalent would be

from gu in context.Gene
join cu in Context.Cont
on gu.Code_Unit equals cu.Code_Unit
select new 

Use LinqPad to generate queries and to learn Linq

share|improve this answer
What do you mean "it doesn't mention the 'FROM clause'" ? –  Misi Feb 14 '12 at 20:22
@Misi ignore my comment about From clause. Just look at the code. –  Hasan Khan Feb 14 '12 at 21:01
up vote 0 down vote accepted
ARHIEntities ARHModel = new ARHIEntities(); // ARHIEntities is the model name
var qry = from gu in ARHModel.gene_genunit
          from cu in ARHModel.cont_unitati
          where gu.COD_UNIT == cu.COD_UNIT
          select new { cu, gu };

EDIT: added a where clause

share|improve this answer
This is a cross join and its not same as doing left join in sql. –  Hasan Khan Feb 14 '12 at 21:01

Your Answer


