Robin's Blog

记录 积累 学习 成长

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

dataset 排序

//DataView    
  DataView   dv   =   new   DataView();  
  dv.Table   =   DataSet1.Tables["Suppliers"];  
  dv.RowFilter   =   "City   =   'Berlin'";  
  dv.Sort   =   "CompanyName   DESC";  
   
   
  //Select  
  string   strExpr;  
  string   strSort;  
   
  strExpr   =   "id   >   5";  
  //   Sort   descending   by   column   named   CompanyName.  
  strSort   =   "name   DESC";  
  //   Use   the   Select   method   to   find   all   rows   matching   the   filter.  
  DataRow[]   foundRows   =    
  customerTable.Select(   strExpr,   strSort,   DataViewRowState.Added   );
posted on 2009-08-18 14:21  Robin99  阅读(115)  评论(0)    收藏  举报