Each data source provides its own technique for searching and manipulating individual items. What’s common in all data sources is the operations we perform with the data: We want to be able to query the data and select the values we’re interested in. … [Read more...] about What Is LINQ? , LINQ Components
Querying Collections and XML with LINQ
LINQ to Objects
This section focuses on querying collections of objects. As you can guess, the most interesting application of LINQ to Objects is to select items from a collection of custom objects. Let’s create a custom class to represent products: I’m not … [Read more...] about LINQ to Objects
Aggregating with LINQ
LINQ allows you to query for aggregates too. By default, it adds a few extended methods for calculating aggregates to all collections. Let’s return to our array of integers, the data array. To calculate the count of all values, call the Count method … [Read more...] about Aggregating with LINQ
LINQ to XML / Traversing XML Documents
In this section, we’ll move on to a more interesting component of LINQ, the LINQ to XML component. XML is gaining in popularity and acceptance, and Microsoft has decided to promote XML to a basic data type. Yes, XML is a data type like integers and … [Read more...] about LINQ to XML / Traversing XML Documents
Adding Dynamic Content to an XML Document
The XML documents we’ve built in our code so far were static. Because XML support is built into VB, you can also create dynamic context, and this is where things get quite interesting. To insert some dynamic content into an XML document, insert the … [Read more...] about Adding Dynamic Content to an XML Document
LINQ to SQL
SQL stands for Structured Query Language, a language for querying databases. SQL is discussed in detail in Chapter "Basic Concepts of Relational Databases", and as you will see, SQL resembles LINQ. If you are not familiar with databases and SQL, you … [Read more...] about LINQ to SQL