Direct answer: you'd need to put the whole If (question IsNot Nothing) Then
block in a loop like For Each. As the compiler correctly informs - the i
variable holds the whole list, not one of its items. Perhaps you forgot you left the LINQ query?
A better solution: I believe you could just use AndAlso q.QuestionText IsNot Nothing
- it spares you the need to allocate a new list and to fill it one by one - the following code should do the trick.
Public Shared Function RetrieveQuestions(ByVal QuestionType) As List(Of String)
Dim db As New DBDataContext()
db.CommandTimeout = 300
Dim ListOfQuestions As List(Of String) = (
From q As Question In db.Questions.ToList
Where
q.FormType = QuestionType
AndAlso q.QuestionText IsNot Nothing
Select q.QuestionText
).ToList
Return ListOfQuestions
End Function