用DataTable的Select方法,它即可以实现DataView的一切排序功能还可以实现DataView的一切数据筛选功能,DataView能实现的,DataTable都能实现,DataView不能实现的,DataTable也能实现 :)

解决方案 »

  1.   

    For example:
    string fltString="DestPortAbbr='SH'";
    string sortString="DestPortAbbr";

    BookingData ds=(BookingData)Session["BookingDS"];
    DataView dv=ds.Tables[BookingData.BOOKING_TABLE].DefaultView;
    dv.RowFilter=fltString;
    MyDataGrid.DataSource=dv;
    MyDataGrid.DataBind();
    DataRow[] foundRows=ds.Tables[BookingData.BOOKING_TABLE].Select(fltString,sortString);
    //很显然foundRows[]中的记录数和DataView所选择过的数据一样的
    //因此,Count(DataView.记录数)=Count(foundRows.Length)
      

  2.   

    感谢wacle大哥,你比我们公司的技术经理都要厉害 :)