原来SQL需翻成linq:
sql=“select Code, StudentName from [Student]” if(TeacherName!=""){ sql+=" ,[Teacher] where [Student].TeacherName = [Teacher] .TeacherName Where [Teacher].TeacherName=TeacherName" }
可以写成一条Linq语句嘛?还是只能根据条件写两条Linq?
相关问题
- Check if tie in count of lists using linq
- Trouble with OR in Sharepoint CAML
- get key value pairs from xml using linq
- query and create objects with a one to many relati
- select column from dataset using LINQ
相关文章
- 想问问Linq中有没有根据条件选择要不要关联表。
- Why do I need a ToList() to avoid disposed context
- LINQ .Include() properties from sub-types in TPH i
- Can a method chain be called LINQ?
- Get grouped comma separated values with linq
- How does a LINQ expression know that Where() comes
-
Creating dynamic Expression
> - Entity Framework - An item with the same key has a
可以,但就你这条查询,在sql里用 exists 代替 连表。
需要写成2条语句,比较好看