Chapter 23 slides - Chapter 23 How to use LINQ Murachs...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
Murach’s Visual Basic 2008, C23 Slide 1 Chapter 23 How to use LINQ
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Murach’s Visual Basic 2008, C23 Slide 2 Objectives Applied Use any of the LINQ features presented in this chapter to query an in-memory data structure such as an array, sorted list, or generic list. Knowledge In general terms, explain how LINQ is implemented. Name the interface that a data source must implement to use LINQ with that data source. Describe the three stages of a query operation. Describe how the type of a query variable is determined. Describe how deferred execution works. Describe when a query operation results in a projection.
Background image of page 2
Murach’s Visual Basic 2008, C23 Slide 3 Objectives (continued) Describe when a query operation results in an anonymous type. Describe the purpose of each of the following LINQ clauses: From, Where, Order By, Select, Join.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Murach’s Visual Basic 2008, C23 Slide 4 An introduction to LINQ Language-Integrated Query (LINQ) provides a set of query operators that are available as keywords from the Visual Basic language. You use these keywords to define a query expression that identifies the data you want to retrieve from the data source. To use LINQ with a data source, the data source must implement the IEnumerable(Of T) interface or another interface that implements IEnumerable(Of T) such as IQueryable(Of T). A data source such as an array or an array list that supports the non-generic IEnumerable interface can also be used with LINQ.
Background image of page 4
Murach’s Visual Basic 2008, C23 Slide 5 Some of the Visual Basic keywords for working with LINQ Keyword Description From Identifies the source of data for the query. Where Provides a condition that specifies which elements are retrieved from the data source. Order By Indicates how the elements that are returned by the query are sorted. Select Specifies the content of the returned elements. Join Combines data from two data sources.
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Murach’s Visual Basic 2008, C23 Slide 6 Advantages of using LINQ Makes it easier for you to query a data source by integrating the query language with Visual Basic. Makes it easier to develop applications that query a data source by providing IntelliSense, compile-time syntax checking, and debugging support. Makes it easier for you to query different types of data sources because you use the same basic syntax for each type. Makes it easier for you to use objects to work with relational data sources by providing designer tools that create object-relational mappings .
Background image of page 6
Murach’s Visual Basic 2008, C23 Slide 7 The three stages of a query operation Get the data source. If the data source is an array, for example, you must declare the array and then assign values to its elements. Define the query expression.
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 08/14/2010 for the course BS computer p taught by Professor Smith during the Spring '10 term at Virtual University of Pakistan.

Page1 / 35

Chapter 23 slides - Chapter 23 How to use LINQ Murachs...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online