LINQ To Object

LINQ to Array

Language Integrated Query introduced in .net framework 3.5. LINQ integrated accessibility of data and query into language. LINQ makes easier to work with data.

Continue...

LINQ to Jagged Array

We can also traverse jagged array using LINQ.

Continue...

LINQ to LIST

In this tutorial we will discuss how to work with LIST using LINQ. For this example i am going to use the user defined data i.e. class. Create class and add some variable in it. I created the class name TechAltum and add some variable in it which is as follows:-

Continue...

Var in LINQ

Var is data type in C# which holds the anonymous data. When you do not know the return type we can hold data in var. The declaration and definition of var type will be declare in the same line.

Continue...

Lambda Expression in LINQ

A lambda expression is an anonymous function. Using lambda expression we can create function for delegate and we can also create expression tree type.

Continue...

LINQ To SQL

LINQ to SQL(Select)

SQL is a structured Query Language. When we need to interact with database using LINQ then we mapped our relational database to object oriented language using LINQ to SQL.

To interact with database we use Datacontext class which is in System.Data.LINQ. This class contains the constructor in which we have to pass the connection string.

Continue...

LINQ to SQL(Insert)

When we insert using LINQ then your table must have primary key. So the table which I was using not contain primary key. So I added one more column name id in the table which is primary and auto generated (used identity). So I have to make following changes in the class which maps my table to object oriented language which is as follows:-

Continue...

LINQ to SQL(Delete)

We use the following code to delete from the database using LINQ:-

Continue...

LINQ to SQL(Update)

We use the following code to update from the database using LINQ:-

Continue...

Aggregate Function in LINQ

Implementation of Aggregate function with Array, Generics and Database

We use many aggregate functions like sum, count, average, min, and max. In LINQ we can use this function in the following manner:-

Continue...

Long Count in LINQ

Long count is similar to count as it works same but the only difference between them is that long count returns a 64 bit integer.

Continue...

Sorting in LINQ

Implementation of Sorting with Array, Generics and Database

To sort data in LINQ we use orderby in the following manner:-

Continue...

Set Operation in LINQ

Implementation of Set Operation in LINQ

We use following set operations in LINQ:-

Continue...

LINQ to XML

Create XML

When we interact with XML using LINQ then it is known as LINQ to XML

To work with XML in LINQ you have to add a namespace using System.Xml.Linq.

Continue...

Traverse XML File using LINQ

In my last article I explained how we can create XML file using LINQ. In this article I will discuss how we can traverse this XML file using LINQ.

Continue...

Concat Method in LINQ

Concat

Concat method is used to concat two data sources. In my last article I used union method to concat two data sources.

Continue...