How do I do this
Select top 10 Foo from MyTable
in Linq to SQL?
Use the Take method:
var foo = (from t in MyTable
select t.Foo).Take(10);
In VB LINQ has a take expression:
Dim foo = From t in MyTable _
Take 10 _
Select t.Foo
From the documentation:
Takeenumeratessourceand yields elements untilcountelements have been yielded orsourcecontains no more elements. Ifcountexceeds the number of elements insource, all elements ofsourceare returned.