LinqConnect Documentation
In This Topic
    LINQ Query Samples
    In This Topic
    LINQ Query Samples
    LinqConnect Documentation
    LINQ Query Samples
    [email protected]

    In this article you will find several examples of LINQ queries that may be useful for your application development. For the wide list refer to 101 LINQ Samples.

    You can download the database scripts from our site to run the following scripts.

    SELECT with Implicit join

    This query shows to us how we can use implicit join in LINQ-statements. We will join Products and Category entities by the Product.Category field.

    SELECT with two from clauses

    This query shows to us how we can build a query with two from clauses. We will select data from two entities: Customers and Orders.

    SELECT with two from clauses and where clauses

    This query is very similar to previous but we define a conditions to Customers and Orders entities. We select only customers from "USA" and orders older than 1998.

    SELECT with more complicated where clause

    In this query we define complicated Where clause - we define customer location and first symbol of its name.

    SELECT with ordering and paging

    In this query we define conditions for paging and ordering. To do it orderby clause, and Skip and Take functions are used.

    SELECT with grouping and aggregate functions

    Using of aggregate functions and group by clause is shown in following query.

    These simple examples should help one to make some ideas of how to use LinqConnect as a convenient way to work with different databases.