将查询转换为linq [英] Converting the query to linq

查看:69
本文介绍了将查询转换为linq的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将以下查询转换为Linq:



从colist中选择*,其中active =是且emp_id不在(从分配中选择emp_id)



请帮助

问候

How to convert the following query to Linq:

Select * from colist where active="Yes" and emp_id not in (select emp_id from assignment)

Please help
regards

推荐答案

使用像LINQPad [ ^ ]这可以节省大量时间

学习SQL到LINQ(视觉表示) [ ^ ]
Use tools like LINQPad[^] which could save lot of time
Learn SQL to LINQ (Visual Representation)[^]


db.Items.Where(x=> x.active== "yes").Select(x=>x.Name).Distinct();



喜欢这个?

否则你可以去< a href =http://www.sqltolinq.com/> http://www.sqltolinq.com/ [ ^ ]

-KR


Like this ??
Or else you can go to http://www.sqltolinq.com/[^]
-KR


这篇关于将查询转换为linq的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆