Join Us On Facebook

Please Wait 10 Seconds...!!!Skip

Thursday, 2 May 2013

LINQ -Knowledge & Practice

LINQ (Language Integrated Query)-

Language Integrated Query is a new feature in Visual Studio 2008 and onward that extends the query capabilities, using C# and Visual Basic. Visual Studio 2008 comes with LINQ provider assemblies that enable the use of Language Integrated Queries with different data sources such as in-memory collections, SQL relational database,ADO.NET Datasets, XML documents and other data sources.

The LINQ language extensions use the new Standard Query Operators API, which is the query language for any collection that implements IEnumerable<T>. It means that all collections and arrays can be queried using LINQ.

The following figure shows the architecture of LINQ, which can query different data sources using different programming languages:

Types of LINQ:

1. LINQ to Objects:-
                                Refers to the use of LINQ queries to access in-memory data structures.We can query any type that supports IEnumerable(Of T) (Visual Basic) or IEnumerable<T> (C#) such as arrays, lists, and other collection types.

2. LINQ to SQL:-
                             LINQ to SQL is used for managing the relational data as objects.LINQ to SQL translates the Language Integrated Queries in the object model to SQL and sends them to the database for execution. When the database returns the result, LINQ to SQL translates them back to objects that we can work with. LINQ to SQL also supports stored procedures and user-defined functions in the database.

3. LINQ to Datasets:
                                    LINQ to Datasets makes it easier to query the data cached in Datasets. A Dataset is disconnected, consolidated data from different data sources.

4. LINQ to Entities:
                                  The Entity Data Model is a conceptual data model that can be used to model the data so that applications can interact with data as entities or objects. Through the Entity Data Model,ADO.NET exposes the entities as objects.

5. LINQ to XML:
                              Using LINQ to XML, we can query, modify, navigate, and save the changes of an XML document. It enables us to write queries to navigate and retrieve a collection of elements and attributes. It is similar to XPath and XQuery.

Next part of this post is LINQ -Knowledge & Practice-part 2

To read more about above types ,you have to wait some time more.
"HAPPY PROGRAMMING !!!"





                              






No comments:

Post a Comment