Tag Archives: LINQ



Ordering data in LINQ Queries by more than one column

In this post I am going to show how to do ordering when you require to order data by using the multiple columns. By using .Orderby(x=>x.Columnname) in the LINQ query we can easily order data of the source collection. So most of new developer make use of the same function two time .Orderby(x=>x.Columnname).Orderby(x=>x.Columnname) and thinks […]

Dynamic query with Linq

In this post I am going to discuss about building dynamic query with the LINQ. LINQ to SQL allow user to query data from the database without writing sql queries by writing LINQ queries. LINQ represent each table as one entity and where LINQ queries allows to manipulate data in type safe. But Static LINQ […]

Default Extension methods

In this post I am going to discuss about Default extension method(s) which are use full when we query the data form the collection,array or performing operation while code using linq to sql. In .net framework there are number of extension methods which allows perform function on the the collection. But problem arise when we […]

Filter Records by RowNumbers in LINQ To SQL

In this tips we are going show how you can filter your data by RowNumbers that you assigned to your record(s). So to filter data in SQL (SQL server-2005) we use RowNumber function and than we use = or BETWEEN to filer data. In above query as you can see ROW_NUMBER() function assign number to […]

How to use SelectMany with LINQ JOINS

  SelectMany is Projects each element of a sequence to an IEnumerable and flattens the resulting sequences into one sequence.In this post I am going to show how you can use SelectMany Extension method to achieve the join between related tables easily without writing long queries. To understand this consider example below As shown in […]

Find duplicate with Linq

This small tips discussed about how to get list of duplicate items for the collection that we do in sql. For example I have to get list of the email id which is get entered in user table more than one time. Linq query work same as on the set of collection and which make […]

LINQ and Nullable Values or SQL ISNULL with LINQ

In this tips I am going to show how you can deal with the Nullable values in LINQ queries and how you can achieve functionality like SQL ISNULL function. Let’s put it as a problem statement I am dealing with the LINQ queries, In which I have to diplay “N/A” were the value is null […]