Filter using LinQ

Hello.

I’ve a use case where I need to filter a data table based on a specific column data. I mean, I need to select an entire row in which a column has the data “Exp”. Any help with LinQ will be appreciated.

Thank You

@Jnanesh_Ballal

Welcome to the community

Please try this…Small corrections to the previous post

dt.AsEnumerable.Where(function(x) x(“ColumnName”).ToString.ToLower.Contains(“exp”)).CopyToDataTable

Where will filter on the condition provided

cheers

1 Like

Hey

(From d In dt
Where d("yourcolumnname").ToString.ToUpper.Equals("EXP")
Select d).Copytodatatable

Regards

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.