Linq (Language Integrated Query) is a great new way of fetching data from a database. If you’ve ever written a data driven application then you know the pain of writing SQL to interact with your database. It’s always seemed clunky to me, here you are creating objects with properties but the way those objects get saved to a database and read back out is in a language completely different from what you program in.
Linq is an attempt to change that. Where a standard query looks like this:
Select col1, col2, col3 from myTable where col1='this'
a Linq query is written in your code and looks like this:
var vProducts = from p in products where p.UnitsInStock > 0 select p;