D4 Introduction to LINQ

409 views

Published on

Introduction to LINQ with C# programming

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
409
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
11
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

D4 Introduction to LINQ

  1. 1. Introduction to LINQ Pakorn Weecharungsan
  2. 2. Contents  What is LINQ?  LINQ Providers  Fundamental LINQ syntax
  3. 3. What is LINQ?  LINQ (Language Integrated Query) is a new feature of C# and Visual Basic .NET t hat integrates into these languages the abi lity to query data
  4. 4. What is LINQ?
  5. 5. LINQ Providers  LINQ to Objects  LINQ to XML  LINQ Support for ADO.NET LINQ to SQL LINQ to Datasets LINE to Entities
  6. 6. Query Syntax and Method Syntax  Query syntax is a declarative form that looks very much like an SQL statement. Query syntax is written in the form of query expressions  Method syntax is an imperative form, which uses standard method invocations. The methods are from a set called the standard query operators
  7. 7. Query Syntax and Method Syntax
  8. 8. The Structure of Query Expressions
  9. 9. The from clause  The from clause specifies the data collection that is to be used as the data source. It also introduces the iteration variable
  10. 10. The join clause  The join clause in LINQ is much like the JOIN clause in SQL
  11. 11. The where Clause  The where clause eliminates items from further consideration if they don’t meet the specified condition. The syntax of the where clause is the following
  12. 12. The where Clause
  13. 13. The orderby Clause  The orderby clause takes an expression and returns the result items in order according to the expression
  14. 14. The orderby Clause
  15. 15. The group Clause  The group clause groups the selected objects according to some criterion. For example, with the array of students in the previous examples, the program could group the students according to their majors
  16. 16. The group Clause
  17. 17. The Standard Query Operators  The standard query operators comprise a set of methods called an application programming interface (API) that lets you query any .NET array or collection
  18. 18. The Standard Query Operators

×