LINQ is a type of
query language. A query is a type of expression that retrieves data from a
source. Different languages have been developed over time for the various types
of data sources, for example SQL for relational databases and XQuery for XML.
LINQ is used in C#
(which is a Desktop application development high level language) to retrieve
data. It is almost similar to SQL (Structured Query Language), only little bit
difference in syntax.
Example
of LINQ
class IntroToLINQ
{
static void Main()
{
// The Three Parts of a LINQ Query:
// 1. Data source.
int[] numbers = new int[7] { 0, 1, 2, 3, 4, 5,
6 };
// 2. Query creation.
// numQuery is an IEnumerable<int>
var numQuery =
from num in numbers
where (num % 2) == 0
select num;
// 3. Query execution.
foreach (int num in numQuery)
{
Console.Write("{0,1} ", num);
}
}
}
Here is the list of all functions provided in the downloadable file.
If you want to know more about LINQ then you can download this file from here and check all the operations and the functions used in LINQ.
Post a Comment