Introduction to LINQ Queries
Category: System.Linq, viewed: 155 time(s).
LINQ (Language Integrated Query) is a language feature that allows a common way to access or query different type of data sources. In the previous technology we might have seen many query languages such as SQL for relational database, XQuery for XML data, etc.
LINQ on the other hand offers developer a consistent model for working across various kind of data sources. We can use LINQ to work with objects, array, file system, accessing SQL databases, XML documents, .NET collections, ADO.NET databases.
As long as a LINQ provider available for a certain type of data then we can use a LINQ query to work with that data source.
Here is an example on how to LINQ simplify a program for accessing even and odd numbers from an array of integer.
The program above will print out the following results:
Even numbers: 2 4 6 8 10 Odd numbers: 1 3 5 7 9
Related Examples
|
|