我看过很多地方,我在 C# 中看到过几个地方,但在 VB.NET 中什么也没有。所以这里是设置。我有 3 张桌子。它们的格式如下
Quiz
=========
ID
CourseID
PassingNumber
Question
==========
ID
QuizID
QuestionText
Answer
==========
ID
QuestionID
AnswerText
IsCorrect
我想查询它们将它们放入对象列表中。基本上我想这样做:
Dim quizzes = From qui In Quiz
Where qui.CouseID = courseID (This variable is passed from a function)
Select qui.ID, qui.PassingNumber
For Each qui.ID
From que In Question
Where que.QuizID = qui.ID
Select que.ID, que.QuestionText
For Each que.ID
From ans In Answer
Where ans.QuestionID = que.ID
Select ans.AnswerText, ans.IsCorrect
我知道 For Each 应该类似于 Join,但我似乎无法完全掌握这个概念。如果我看到它,我想我会的。