首页 新闻 会员 周边

问个LINQ 多表查询问题

0
[待解决问题] 解决于 2011-03-18 11:36

我有3个表 表A 表B 表C

现在要通过先查询表A某个字段F,然后再关联查出表C的结果

就是

表A->表B->表C

 

我原先这么写,好像不行

                    query =
                            from p in context.Ship_Ports
                            where p.Ship_Port_line.== search.LineId
                            from e in context.Charges_End_cool
                            where e.ePort_ID == p.Ship_Port_id
                            from c in context.Charges_cool
                            where c.Charges_Begin_id == e.Charges_Begin_ID
                            select c;

墙头草的主页 墙头草 | 初学一级 | 园豆:6
提问于:2011-03-03 11:36
< >
分享
所有回答(1)
0

query=from p in context.Ship_Ports

          from e in context.Charges_End_cool

           from c in context.Charges_cool

where    p.Ship_Port_line.== search.LineId && e.ePort_ID == p.Ship_Port_id && c.Charges_Begin_id == e.Charges_Begin_ID
      select c;

奋斗张 | 园豆:514 (小虾三级) | 2011-03-03 11:57
我刚试过这么写了,貌似也不行...
支持(0) 反对(0) 墙头草 | 园豆:6 (初学一级) | 2011-03-03 12:00
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册