Database Reference
In-Depth Information
• LINQ offers common syntax for querying any type of data source; for example, you
can query an XML document in the same way you query a SQL database, an
ADO.NET dataset, an in-memory collection, or any other remote or local data
source that you have chosen to connect to and access by using LINQ.
• LINQ bridges the gap and strengthens the connection between relational data and
the object-oriented world.
• LINQ speeds development time by catching many errors at compile time and
including IntelliSense and debugging support.
• LINQ query expressions (unlike traditional SQL statements) are strongly typed.
Note Strongly typed expressions ensure access to values as the correct type at compile time and so prevent
type mismatch errors from being caught when the code is compiled rather than at runtime.
The LINQ assemblies provide all the functionality of accessing various types of data stores under
one umbrella. Table 18-1 lists the core LINQ assemblies.
Table 18-1. Core LINQ Assemblies
Assembly Name
Description
System.LINQ
Provides classes and interfaces that support LINQ queries
System.Collections.Generic Allows users to create strongly typed collections that provide better type
safety and performance than nongeneric strongly typed collections
(LINQ to Objects)
System.Data.LINQ
Provides the functionality to use LINQ to access relational databases
(LINQ to SQL)
System.XML.LINQ
Provides functionality for accessing XML documents using LINQ (LINQ
to XML)
System.Data.Linq.Mapping
Designates a class as an entity class associated with a database
Note Though it's called Language Integrated Query , LINQ can be used to update database data. We'll cover
only simple queries here to give you your first taste of LINQ, but LINQ is a general-purpose facility for accessing
data.
 
 
Search WWH ::




Custom Search