Manoj Kumar
How to Filter the Data in Data Table?
By Manoj Kumar in .NET on Dec 19 2016
  • Manoj Kumar
    Dec, 2016 19

    We can do it by using two different approaches 1.DataTableObjectName.Select(Condition) e.g..,DataTable table = DataSet1.Tables["Orders"];// Presuming the DataTable has a column named Date.string expression;expression = "Date > #1/1/00#";DataRow[] foundRows;// Use the Select method to find all rows matching the filter.foundRows = table.Select(expression);// Print column 0 of each returned row.for(int i = 0; i < foundRows.Length; i ++){Console.WriteLine(foundRows[i][0]);}2.Using RowFIlterdataView.RowFilter = "id = 10";

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS