LINQ Tutorials

Tutorials for LINQ Beginners

1. LINQ In General

https://youtu.be/2FlgUDtOoVc

2. LINQ Group Function

https://youtu.be/kMMYEOkq39w

3. LINQ Join Function

https://youtu.be/z3srG9JwR4A

4. LINQ Let Function

https://youtu.be/C17UU9aoiHY

5. LINQ Sum Function

https://youtu.be/_kOK6Q-VPVw

6. LINQ Cast Function

https://youtu.be/HFam-My6T4k

7. LINQ IF Condition

https://youtu.be/liNxZ2AhGpo

8. LINQ for XML

https://youtu.be/PfvaNGCW6Hk

23 Likes

these have been very helpful for me !! well worth a watch and subscription

1 Like

Hello,
I have an excel with 473 columns, in which I want only 61 columns. How can I write through LINQ Query. Please help me with this.

@ISBS_ROBOT
Do you know which columns do you need? Is there an array which contains the columns you need?
Or the columns you need start with specific letter, or end with specific letter, or contains something special?
Any information about the issue, so that I can help you!

Yes bro,
I know which columns I need. I have the headers of columns which I want.

Hello,
Here I want only specific columns based on headers and I need to pick with those headers.
And columns position doesn’t change. Normally It’s taking lot of time to execute. I’m in need of LINQ Query. Please help me with this.

Hey

I know , it’s an old question but in case someone else is facing the same issue.
This might help:

  1. First of all, you should have the columns you need in a array of strings : Arr_Colums = New String(){“Column1”,“Column2”,…“ColumnX”}
  2. Second proceed as following:
    dt_FilteredData = dt_Data.DefaultView.ToTable(False, Arr_Columns)

dt_Data is your original Datatble, dt_FilteredData is the new Datatable and Column1 , Column2 ColumnX are the columns you need in the filtered Datatable.

Please Mark this as Solution, if it’s useful to you.