THE MANY FACES OF LINQ
LINQ (Language Integrated Query, pronounced “link”) is a data-selection mechanism designed to give programs the ability to select data in the same way from any data source. Ideally the program would be able to use exactly the same method to fetch data whether it’s stored in arrays, lists, relational databases, XML data, Excel worksheets, or some other data store. Currently the LINQ API supports data stored in relational databases, objects within the program stored in arrays or lists, and XML data.
LINQ queries often let a program make complex data selections with very little code. For example, suppose you’re writing a billing program and you want to list customers with outstanding balances ordered by their balances. You could certainly use Visual Basic code to loop through a customer list to find the customers and then sort the results, but a LINQ query can find and order them in a few simple lines. The result isn’t always as fast as optimized Visual Basic code but it is often much simpler ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access