Posts Tagged 'LINQ Queries'

Sample LINQ Queries in .net

Posted on May 20 2010 by Sachin Jain

1) Simple Query
var CustQuery= from cust in customers
select cust;
2) Where Clause

var DelhiCustomerQuery = from cust in customers
where cust.City == “Delhi”
select cust;
Logical Operator
where cust.City==”delhi” && cust.Name == “mumbai”
3) Order by
var DelhiCustomerQuery = from cust in customers where cust.City == “Delhi” orderby cust.Name ascending
select cust;
4) Group by
var QueryGroupByCity = from cust in customers group cust by cust.City
Now [...]

Get Adobe Flash playerPlugin by wpburn.com wordpress themes

Powered by Sachin Jain

Powered by Olark