This is second part of the "LINQ" series of articles that I have started. And in this article, you will see some quick examples on LINQ title.
As I said in previous article, with LINQ you just need to perform three distinct actions: Obtain the Data Source, create the query and execute the query. You will see in sample programs given below. We will create Console Apps and test various LINQ concepts. I will walk through very simple programs here and in subsequent parts will dig in depth.
LINQ has the great ability to query on any source of data that could be collections of objects (in-memory data, like an array), SQL Database or XML files. We can easily retrieve data from any object that implements the IEnumerable<T> interface.
LINQ to Array
Let's look at a Program to find Even Numbers using LINQ to Array.

If you execute the above program, you will get "2 4 6 8 10" as the output. You will notice 3 actions above, these actions will be changed always depending upon our project requirements. In the above example, the "data source" was an array that implicitly supports the generic IEnumerable<T> interface.
LINQ to XML






Gowtham RajamanickamPosted Apr 11, 2015, 1:28 PM
useful
Gowtham RajamanickamPosted Apr 11, 2015, 1:28 PM
great stuff
Lajapathy ArunPosted Sep 6, 2012, 2:47 PM
nice and simple :)
Abhimanyu K VatsaPosted Sep 4, 2012, 3:01 AM
Thanks Kamal Sir :)
Kamal RawatPosted Sep 4, 2012, 2:16 AM
Nice one Abhimanyu..Very simple and good example to learn from it..
Abhimanyu K VatsaPosted Sep 4, 2012, 12:13 AM
Thank You Sir :)
Mahesh ChandPosted Sep 3, 2012, 6:59 PM
Nice!