如何在Linq中转换Sql查询 [英] How to Convert the Sql Query in Linq
本文介绍了如何在Linq中转换Sql查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的所有
如何将以下sql server查询转换为linq并将其保存到变量
选择姓名
来自tblStudent
其中Stid = 106
Dear All
How to convert the following sql server query in to linq and save it in to a variable
select Name
from tblStudent
where Stid=106
推荐答案
类似下面的内容
Something like following
var studName=
from tbl in objDataContextClass.GetTable<tblstudent>()
where tbl.Stid==106
select tbl.Name;
在实际实现之前,您需要学习一些东西。阅读这篇文章
C#中简单的LINQ to SQL [ ^ ]
希望,它有帮助:)
You need to learn few things before you can actually implement this. Read this article
Simple LINQ to SQL in C#[^]
Hope, it helps :)
这篇关于如何在Linq中转换Sql查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文