CODEDIGEST
Home » FAQs
Search
 

Technologies
 

What is LINQ?
Submitted By Bala Murugan
On 3/4/2010 10:25:25 AM
Tags: Interview Questions,LINQ  

What is LINQ?

 

LINQ stands for Language Integrated Query.  LINQ is a data querying methodology which provides querying capabilities to .Net languages with syntax similar to SQL query. LINQ has a set of querying operators that can be used to query in memory object collection, Sql database, XML, etc. LINQ processing engine will then convert the LINQ query to native query specific to the database to execute against the datasource. 

 

Since, the querying feature is integrated with the language; one can build an efficient query based on the language of their choice.  With Visual Studio, we have intellisense support and with language support, we have type safety and compile-time error checks.

 

LINQ was released with .Netframework 3.5. Microsoft also released LINQ to SQL, LINQ to Entities which is the Microsoft answer to ORM(Object Relation Mapper) framework for connecting to database. These frameworks use LINQ as the basic querying language. LINQ will also work seamlessly with almost every .net collection object which is commonly called as LINQ to Objects in Microsoft term. LINQ can also be used to query XML files which is called as LINQ to XML.

 

Below is a simple LINQ query that fetches employee information from Employees table and populates a GridView control.

 

var LINQQuery = from emp in dbEmp.Employees

                        select emp;

        gvEmployee.DataSource = LINQQuery;

        gvEmployee.DataBind();

 

Recent FAQs
  • View All FAQs..