可以在将SQL查询转换为LINQ查询时帮助我吗 [英] can any one hlp me in converting sql query to linq query

查看:41
本文介绍了可以在将SQL查询转换为LINQ查询时帮助我吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁能帮助我将此sql查询转换为linq查询

 选择 a,b,c,d,e
来自 table1
加入 table2
 usr_id =用户ID
其中 usr_id 中
(表3选择 > 
    usr_id =  1   and  contacts_id =  1 ) 

解决方案

尝试 Linqer [ http://stackoverflow.com/questions/296972/sql-to-linq-tool [ ^ ]



这是嵌套查询.因此,您应该尝试在linq中搜索嵌套查询.
对于参考,请尝试以下操作:

http://msdn.microsoft.com/en-us/library/bb399403.aspx [ ^ ]
http://weblogs.asp.net/scottgu/archive/2007/05/19/using-linq-to-sql-part-1.aspx [使用更好的示例更好的LINQ [select a, b, c, d, e from table1 join table2 on usr_id = userid where usr_id in (select contacts_id from table3 where usr_id = 1 and contacts_id = 1)

解决方案

Try Linqer[^].

For other answers: http://stackoverflow.com/questions/296972/sql-to-linq-tool[^]


Hi,

This is nested query. So, you should try searching nested query in linq.
For the references try this:

http://msdn.microsoft.com/en-us/library/bb399403.aspx[^]
http://weblogs.asp.net/scottgu/archive/2007/05/19/using-linq-to-sql-part-1.aspx[^]
Better LINQ with better example[^]

All the best.
--AK


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

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