Method-Based Query Examples (LINQ to DataSet)
This section provides LINQ to DataSet programming examples in method-based query syntax that use the standard query operators. The DataSet used in these examples is populated by using the FillDataSet method, which is specified in Loading Data Into a DataSet. For more information, see Standard Query Operators Overview.
The examples in the following topics use the following using/Imports statements:
Option Explicit On
Imports System
Imports System.Linq
Imports System.Linq.Expressions
Imports System.Collections.Generic
Imports System.Data
Imports System.Data.SqlClient
Imports System.Data.Common
Imports System.Globalization
using System;
using System.Linq;
using System.Linq.Expressions;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Data.Common;
using System.Globalization;
In This Section
Projection Method-Based Query Syntax Examples (LINQ to DataSet)
The examples in this topic demonstrate how to use the Select and SelectMany methods to query a DataSet.Partitioning Method-Based Query Syntax Examples (LINQ to DataSet)
The examples in this topic demonstrate how to use the Skip<TSource> and Take<TSource> methods to query a DataSet and partition the results.Ordering Method-Based Query Syntax Examples (LINQ to DataSet)
The examples in this topic demonstrate how to use the OrderBy, OrderByDescending, Reverse<TSource>, and ThenByDescending methods to query a DataSet and order the results.Set Operators Method-Based Query Syntax Examples (LINQ to DataSet)
The examples in this topic demonstrate how to use the Distinct, Except, Intersect, and Union operators to perform value-based comparison operations on sets of data rows.Conversion Operators Method-Based Query Syntax Examples (LINQ to DataSet)
The examples in this topic demonstrate how to use the ToArray<TSource>, ToDictionary, and ToList<TSource> methods to immediately execute a query expression.Element Operators Method-Based Query Syntax Examples (LINQ to DataSet)
The examples in this topic demonstrate how to use the First and ElementAt<TSource> methods to get DataRow elements from a DataSet.Aggregate Operators Method-Based Query Syntax Examples (LINQ to DataSet)
The examples in this topic demonstrate how to use the Average, Count, Max, Min, and Sum methods to query a DataSet and aggregate data.Join Method-Based Query Syntax Examples (LINQ to DataSet)
The examples in this topic demonstrate how to use the GroupJoin and Join methods to query a DataSet.
See Also
Concepts
Query Expression Examples (LINQ to DataSet)
DataSet-Specific Operator Examples (LINQ to DataSet)