Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用以下代码从包含一堆课程的表中选择每门课程 - 我将如何更改代码以缩小从每门课程到每门课程的选择范围,字段为 db.Courses.myField = true?
var courses = from s in db.Courses select s;
这很简单...
var courses = from s in db.Courses where s.myField == true select s;
查看 asp.net 上的数据教程。
使用 Linq,
var courses = db.Courses.Where(s=>s.myField == true);