Filter using LinQ


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


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


1 Like


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


1 Like

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