我需要下面的SQL查詢轉換爲LINQ查詢轉換一個SQL查詢到的LINQ to SQL指令
select *
from bancos
where codigobanco in
(select distinct codigobanco
from headerarquivo
where (MONTH(datahorageracao)=12) and (YEAR(datahorageracao)=2010))
我怎麼能這樣做的LINQ查詢轉換這個SQL查詢?
我明白了在ouroDB.HeaderArquivoes \t \t \t \t \t。凡(H => h.DataHoraGeracao.Month == dtpGeracao.Value.Month) \t \t使用LINQ到實體 \t VAR淺灘=(從公頃\t \t \t。凡(H => h.DataHoraGeracao.Year == dtpGeracao.Value.Year) \t \t \t \t從公元前ouroDB.Bancos \t \t \t(b => b.CodigoBanco.Contains(ha.CodigoBanco)) \t \t \t \t select bc).Distinct()。OrderBy(b => b.NomeBanco); – Ederaldo 2010-12-09 17:32:16