Linq Example

Nishithraj
Posted by Nishithraj under ASP.NET category on | Views : 1824
LINQ (Language Integrated Query) is an unique technology implemented by microsoft to minimize the coding for querying a collection.
Here it's possible to order them also.

class applicationLINQ
{
static void Main()
{
string[] names = { "DotNetFunda", "Google", "Microsoft","Yahoo"};

IEnumerable expr = from s in names
where s.Length == 5
orderby s //here we can also mention the order of sorting as ascending or descending
select s.ToUpper();
foreach (string item in expr)
Console.WriteLine(item);
} }
from p in persons join w in workers
on new { p.FirstName, p.LastName } equals new
{ w.FirstName, w.LastName }
select p;
Or
Join o in orders on p.ProductID equals o.ProductID

Comments or Responses

Login to post response