Comparing Linq and SQL
Prove you're a Dev Guru! Take the test now!
Linq ('Language Integrated Query') is a Microsoft programming model that adds formal data querying capabilities to .NET-compliant languages. You can project, filter and traverse data in arrays, enumerable classes and relational databases using native .NET language syntax for queries. To see Linq at work, take a look at the following example:
using System;
using System.Linq;
using System.Collections.Generic;
class MyLinqApp
{
static void Main()
{
string[] myData = { "Microsoft", "IBM", "Intel", "Sun Microsystems", "AMD" };
IEnumerable<string> myLinqQuery = from data in myData
where data.Length < 4
orderby data
select data.ToUpper();
foreach (string data in myLinqQuery)
Console.WriteLine(data);
}
}
Recommended Articles
blog comments powered by Disqus
