how to search the dataset for specific data

前端 未结 1 1447
Happy的楠姐
Happy的楠姐 2021-01-20 10:46

I just wanted to ask how to search dataset for specific data because I want to search summary for specific keywords and bind it to repeater I have where expression and it

1条回答
  •  既然无缘
    2021-01-20 11:28

    You could use the DataTable.Select() method. http://msdn.microsoft.com/en-us/library/t5ce3dyt.aspx

    Microsoft's example:

      // Presuming the DataTable has a column named Date. 
      string expression = "Date = '1/31/1979' or OrderID = 2";
      // string expression = "OrderQuantity = 2 and OrderID = 2";
    
      // Sort descending by column named CompanyName. 
      string sortOrder = "CompanyName ASC";
      DataRow[] foundRows;
    
      // Use the Select method to find all rows matching the filter.
      foundRows = table.Select(expression, sortOrder);
    

    0 讨论(0)
提交回复
热议问题