In order to retrieve the highest value of a column in a list of collection, Linq offers a handy method to achieve this;

Dim maxUnitsInStock = Aggregate prod In db.Products _

                      Into Max(prod.UnitsInStock)

Simple!

By | 2012-12-16T21:02:00+00:00 December 16th, 2012|.Net Framework, Data, Linq, VB.net|0 Comments

About the Author:

Leave A Comment