---
title: "Linq to SQL Select Query explanation."  
description: "Linq to SQL Select Query explanation."  
author: "Ashutosh Patel"  
published: 2025-02-12  
updated: 2025-02-13  
canonical: https://www.mindstick.com/forum/161160/linq-to-sql-select-query-explanation  
category: "linq"  
tags: ["linq", "linq to sql", "linq function"]  
reading_time: 2 minutes  

---

# Linq to SQL Select Query explanation.

[Linq to SQL](https://www.mindstick.com/articles/338528/how-to-use-linq-to-sql-select-query-using-c-sharp) [Select Query](https://www.mindstick.com/articles/1858/sqlite-select-query) explanation.

## Replies

### Reply by Amrith Chandran

#### LINQ Concat() in C#

The `Concat()` method in LINQ is used to combine two sequences (collections) into a single sequence without removing duplicates.

## Basic Syntax

```cs
var CombineCollection = firstCollection.Concat(secondCollection);
```

- Returns a new sequence that contains all the elements of `firstCollection`, followed by all the elements of `secondCollection`.
- Does not modify the original collection.
- Does not remove duplicates (unlike Union()).

## Example with int type collection-

```cs
using System;
using System.Collections.Generic;
using System.Linq;
namespace MyConsoleApplication
{
   class MindStickSoft
   {
       static void Main()
       {
           List<int> numbers1 = new List<int> { 1, 2, 3 };
           List<int> numbers2 = new List<int> { 4, 5, 6 };
           var combined = numbers1.Concat(numbers2);
           Console.WriteLine("Concatenated List: " + string.Join(", ", combined));
           // Output: Concatenated List: 1, 2, 3, 4, 5, 6
       }
   }
}
```

The above program combines the two integer list into a new integer list.

## Example with string type collection

```cs
using System;
using System.Collections.Generic;
using System.Linq;
namespace MyConsoleApplication
{
   class MindStickSoft
   {
       static void Main()
       {
           List<string> names1 = new List<string> { "Alice", "Bob" };
           List<string> names2 = new List<string> { "Charlie", "David" };
           var result = names1.Concat(names2);
           Console.WriteLine("Concatenated Names: " + string.Join(", ", result));
           // Output: Concatenated Names: Alice, Bob, Charlie, David
       }
   }
}
```

## When to use Concat()

- When you want to merge two collections while keeping duplicates.
- When working with different types of sequences.
- When you need to preserve the order of both collections.

**Also, read:** [How to use DefaultIfEmpty() function in LINQ with C#?](https://www.mindstick.com/forum/161158/how-to-use-defaultifempty-function-in-linq-with-c-sharp)


---

Original Source: https://www.mindstick.com/forum/161160/linq-to-sql-select-query-explanation

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
