在DataView中有以下的数据
A     B     C    D
1200  dd    ds   xx
0800  adf   sd   sdfsdf
1432  1asd  df   dfds
2213  sdf   sadf sdf
其中A表示的是时间,我想过滤出用户输入的两段时间的值,比如输入框是TextBox1,TextBox2,
用户输入的值是TextBox1.Text=0900,TextBox2.Text=1500,则过滤出来的值应该是
A     B     C    D
1200  dd    ds   xx
1432  1asd  df   dfds
请问这个过滤条件怎样写?

解决方案 »

  1.   

    .RowFilter = "A>='" + TextBox1.Text + "' AND A<='" + TextBox2.Text + "'";试试
      

  2.   

    DataView dv = new DataView();
    .....
    dv.RowFilter = "A in ("+TextBox1.Text+","+TextBox2.Text+")";
      

  3.   

    DataView dv = new DataView();dv.RowFilter="A>='" + DateTime.Parse(TextBox1.Text) + "' AND A<='" + DateTime.Parse(TextBox2.Text) + "'";
      

  4.   

    RowFilter += "( StartDate >= #" & TxtDate1.Text & "# And StartDate <= #" & DateTime.Parse(TxtDate2.Text) & "# )"