Split String using Linq
In this example, I have demonstrate, how to Split a string using Linq query.Here’s is a solutionDefault.aspx<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0...
View ArticleHow to get All Files list from a directory using Linq
In this example, I have told you how to get all Files list from a specific directory using Linq query. File Info Class which will return the history of file e.g. (creation, modify date, opening of...
View ArticleCustom Paging in Repeater Using LINQ - Part III
I have made this project in visual studio 2010, using Linq you must have Frame work 3.O. In Repeater there is no build in paging. I will tell you how to implement custom paging using Linq.LINQ stands...
View ArticleHow to delete record with LINQ
In this example you will see who to delete record from database which match the id in the patient table.Let’s see the example using (var db = newPatientDataContext()) {...
View ArticleHow to insert record with LINQ
In this example you will see how to insert record in database using linq. Create a DataClasses.dbml file. Open DataClasses.dbml file. Open Server Explorer and connect to database. Expand Tables node...
View ArticleDifference between Enumerable.First() and Enumerable.FirstorDefault() method
In this example you will see that what is difference between Enumerable.First() method and Enumerable.FirstOrDefault() method. Enumerable.First() method return a first record but if there is no record...
View ArticleHow to fetch top 5 records from a list using Linq
The following code example demonstrates how to fetch top five records from a list using Linq query. I will extend my pervious example "Display total price in Repeater footer in asp.net using jquery" to...
View ArticleWHERE IN (Value1, Value2, Value3, Value4, Value5 …) query using Linq
This example demonstrates how to check multiple values using Linq to find out the required result, by using Contains () Method you can find out the required result which is equivalent to WHERE IN type...
View ArticleGenerating a Case Statement in LINQ to SQL using VB.NET/CSharp
In this tutorial you will see if result is "F" we will convert it into "Female" and if result is "M" we will convert it into "Male" and other cases we will convert into "Other" using Linq case...
View ArticleFind duplicate string using Linq in asp.net.
In this example, you will see that how to find out duplicate strings using linq in asp.net. In order to find duplicate string we will use GroupBy method and if any group has a count greater then 1,...
View ArticleDistinct on a column using Linq and bind to Gridview
Yesterday developer asked me, distinct method on a column using linq is not woking. So, i have decided to wite this example in my blog to share with all of you. Let’s startOpen your Visual Studio...
View ArticleLinq to SQL Connection in asp.net
Serval times this question has been asked from me that how to create linq to SQL connection in asp.net. So, i have decided to write this example here.In this example, I have used northwind database....
View ArticleFind Maximum & Minimum number from a Generic List using Linq to SQL.
Today, I have used Max (), Min () aggregate operators in my web project. It is very simple. Let’s start.Make sure you have added using System.Linq; name space.Here’s is the solution...
View Article