DataSet.Select()获得的DataRow数组绑定DataGrid

解决方案 »

  1.   

    LZ什么意思?
    要将DataSet绑定DataGrid的话,直接可以这样么:
    DataSet ds=new DataSet();
    //。省略了给ds获取值的代码
    dataGrid.DataSource=ds.Tables[0];
    dataGrid.DataBind();
      

  2.   

    不要用select,用RowFilter,类似ds.Tables[0].DefaultView.RowFilter="ID='02'";
      

  3.   

    不建议DataRow数组绑定DataGrid 
    同样的效果,建议用DataView.RowFilter实现DataTable dt = ..........;
            DataView dv = dt.Copy().DefaultView;
            dv.RowFilter = "[field1]>1";
            DataGrid1.DataSource = dv;
            .............
      

  4.   

    感谢各位的回复
    我是看论谈时用select方法来过滤
    不像一开始写一大堆判断条件
    这个方法我还是第一次用多谢各位的支持~