Language Integrated Query (LINQ) is one of the most important additions in the .NET Framework in version 3.5.
Most of the developers are familiar with Structured Query Language (SQL). SQL is used to query relational database data ie to
perform operations on the data of the relational database. However, sometimes, the SQL queries that retrieve data from a relational database schema are abstracted away from business logic and middle-tier code. Furthermore, the representation of the data at the business logic and code level is generally through objects, arrays, and collections. So the developers have to regularly search for these constructs using the tailor-made loops.
From a long time, it has been a requirement for many programmers to have a language which can be used for querying data stored in programming constructs and object oriented mechanisms. One stable and well-entrenched industry standard is the SQL. It would be impossible to extend SQL so that it could be used to query programming constructs. However, Microsoft's ambition was to make things easier for programmers by creating a standard for querying data stored in coding constructs. Their efforts resulted in a new query language that targets data stored in objects and collections, which was named Language Integrated Query (LINQ). Moreover, LINQ was also extended to query relational database, XML data, and other data sources to fetch data stored in them. One thing to keep in mind here is that, data queried by using LINQ must be stored as objects. If LINQ is
used to query data from a relational data source, then the data must first be represented using an object model. Keep in touch for more details, lots of interesting things to come up.