A LINQ query is executed in the For Each statement in Visual Basic and in the foreach statement in C#.