Accepted answer

d1.asEnumerable.where(Function(x1) CInt(x1("salary"))>500).copyToDatatable


d1.asEnumerable.where(Function(x1) x1("salary")>500).copyToDatatable if the salary column is already an integer

You may need to add Assembly reference as System.Data.DataSetExtensions if drop down does not appear after you type d1.asEnumerable.


Filter with LINQ:

(From row In YourDataTable.AsEnumerable Where CInt(row("price").ToString) > 500 Select row).CopyToDataTable

If you found error message:

AsEnumerable is not a member of 'System.Data.Datatable'

Please add reference below to your xaml file.




You can also work in a function method approach to LINQ rather than a SQL-like syntax.

DT_Data = DT_Data.AsEnumerable.Where(
  Function(x) CINT(x("Price")) > 500

You can treat data in the DataTable with .Select(Func) Returning you a collection of however you treat the data.

Related Articles