Funding for 'IT Lab' Project, Phase 1: Progress of sticker sales. Purchase a sticker to help us reach our target.Updated: 2010-02-28 11:53
LINQ

One of the Latest Technologies introduced by Microsoft, yes I am talking about LINQ. Still most of the people don’t know what it is and what it can do. LINQ stands for “Language Integrated Query.”
LINQ fundamentally is about integrating query operations into the .NET
platform in a full and open method. It’s also about providing a joined
way for you to query across any kind of data that you have in your
program(database , XML , Array , etc…). The possibilities of
having query capabilities were always available for any language came
with .net environment at your fingertips, regardless of the type of
data you’re working with.

Basically the architecture of the Language Integrated Query is divided into three main categories LINQ to Object, LINQ to ADO.Net and LINQ to XML. Because of that reason it’s easy to understand and implement. Nowadays lots of .net applications use LINQ to establish connections between their back end and front end.
LINQ to Dataset
When
we are dealing with ADO.Net, Dataset is the most primitive component,
and it is a key element of writing programming codes over databases.
However, the DataSet has limited query capabilities. LINQ to DataSet enables you to query into DataSet by using the same query functionality that is used for many other data sources.
LINQ to SQL (formerly DLinq)
LINQ to ENtities
Through the Entity Data Model, relational data is represented as objects in the .NET environment. This allows developers to build queries against the database from the language used to build the business logic. This capability is known as LINQ to Entities.
1. find maximum number of an integer array

int[]arr = { 7 ,2 ,3 ,9 ,5 ,8 ,1 ,4 ,6 ,10 };
Console.WriteLine( arr.Max().ToString() )
2. Get Customer details from Customers Table and print them into the standard output

/*assume that db is the object represent connection with database*/
var cust = from c in db.Customers where c.tot_trnsc_amt > 10000
select c;
foreach (var c in cust)
{
Console.Write(c.name);
|
Relational data |
SQL |
|
XML documents |
XPath |
|
.NET objects |
.NET built-in operators (foreach...) |
|
Relational data |
LINQ |
|
XML documents | |
|
.NET objects |
Post new comment