If you are a Microsoft Access developer you will surely use the DLookup function. Dlookup is a function that queries a data whether it is single, computed or aggregate from a table with a given criteria.
Dim sellingPrice as double sellingPrice = DLookup("sellingPrice","mstItem","itemId=123") Messagebox sellingPrice
The above example code queries the selling price in the mstItem table where itemId is 123. However essential is the DLookup function in Microsoft Access development it is not available in Microsoft Lightswitch, instead the latter provided us with a more powerful tool, LINQ. The LINQ equivalent of the DLookup code above is as follows:
Dim item = (From i In Me.DataWorkspace.mstItem Where i.itemId = 123 Select i).First Me.ShowMessageBox(item.sellingPrice.toString())