If you use at least .NET 3.5, I would suggest using Linq-To-DataTable , as it has become more readable and powerful:
DataTable tblFiltered = table.AsEnumerable() .Where(row => row.Field<String>("Nachname") == username && row.Field<String>("Ort") == location) .OrderByDescending(row => row.Field<String>("Nachname")) .CopyToDataTable();
The above code is just an example; in fact, you have many more methods available .
Remember to add using System.Linq; and for the AsEnumerable extension method, a link to the System.Data.DataSetExtensions dll ( How ).
Rango Oct 22 2018-12-22T00: 00Z
source share