linq
表user int uid,string name
表order int d,intuid,double money
怎么样用linq查询出uid,name,money的信息呢?要两表连接的
------解决方案--------------------var query = from user in User
from order in Order
where user.uid=order.uid
select new
{userid=user.uid,username=user.name,order.money};
foreach(var q in query)
这样???
------解决方案--------------------var query = from u in User
join od in Order
on u.uid equals od.uid
select new
{
userid=u.uid,
username=u.name,
money=od.money
};
------解决方案--------------------var query = from u in User
join od in Order
on u.uid equals od.uid
select new
{
userid=u.uid,
username=u.name,
money=od.money
};