0

Is there any way to possibly filter data in DataTable without using LINQ and Entity Framework? Output can be Enumerable.

I was able to run 2nd line of code using LINQ and Basic filter using myDataTable.Select statement.

myDataTable.Select("[Name] is NULL OR [Name] <> 'n/a'" )

myDataTable.Select("select sum(col1), col2 group by col1, col2")

AD Sharma
  • 13
  • 5
  • 1
    Your two lines of code don't use LINQ but [`DataTable.Select`](https://learn.microsoft.com/de-de/dotnet/api/system.data.datatable.select?view=net-5.0#System_Data_DataTable_Select_System_String_) – Tim Schmelter Mar 15 '21 at 13:17
  • https://learn.microsoft.com/en-us/dotnet/api/system.data.dataview.rowfilter?view=net-5.0 – Crowcoder Mar 15 '21 at 13:19

1 Answers1

-1

DataTable is spesific object and you produce a datatable any ways. For examle with code or with SqlConnection object. What is your database name?

For filter to datatable, i use this code in my project:

dim dt as DataTable
Dim result() As DataRow = dt.Select("ColumnName='" & YourValue & "')