int month = dateTimePicker1.Value.Month;
            var query=from o in oo.CO_BankAccounts.AsEnumerable()
                            where int.Parse(o.COBA_Month) == month
                            select o.Acct_Account.ToList();           var  query1 =from o in oo.V_Fin_OrgAccountMT
                        select o.Acct_Account;
                                   两个表 CO_BankAccounts   as   A 和   V_Fin_OrgAccountMT   as  B 都有相同的字段  Acct_Account,根据表A的时间来查帐号,如果查的帐号在B中存在那么,就存在结转记录,否则就没有....求怎么判断啊  两个集合分别查出来了                                                  

解决方案 »

  1.   

    这样做效率很低的,还是老老实实用sql语句吧,
      

  2.   

     var   query=from   a   in   oo.CO_BankAccounts.AsEnumerable() 
                 from   b   in   oo.V_Fin_OrgAccountMT
                 where   int.Parse(a.COBA_Month)   ==   month &&a.id=b.id
                 select   a.Acct_Account.ToList();