62,046
社区成员
发帖
与我相关
我的任务
分享
var result = from ul in dc.GetTable<UserLog>()
join ip in dc.GetTable<IPAddress>() on ul.LogIp >= ip.StartIP && ul.LogIp <= ip.EndIP
where ul.LogTime >= Convert.ToDateTime(startDate) && ul.OffLineTime <= Convert.ToDateTime(endDate)
select ul;
//你可以这样:
var result = from ul in dc.GetTable<UserLog>()
from ip in dc.GetTable<IPAddress>()
where ul.LogIp >= ip.StartIP && ul.LogIp <= ip.EndIP && ul.LogTime >= Convert.ToDateTime(startDate) && ul.OffLineTime <= Convert.ToDateTime(endDate)
select ul;
select ua.NickName,ip.Address,ul.LogTime from UserLog as ul
inner join IPAddress as ip on ul.LogIp >= ip.StartIP and ul.LogIp <= ip.EndIP
inner join UserAccount as ua on ul.UserId = ua.Id