日期:2014-05-17 浏览次数:20877 次
Select();
Select("id>='3' and name='3--hello'");//支持and
Select("id>='3' or id='1'");//支持or
Select("name like '%hello%'");//支持like
Select("id>5","id desc");
Select("id>5", "id desc",DataViewRowState.Added);
DataTable dt = new DataTable();
dt.Columns.Add("timed", typeof(DateTime));
DataRow dr = null;
dr = dt.NewRow();
dr["timed"] = DateTime.Parse("2013-9-26 12:00:00");
dt.Rows.Add(dr);
dr = dt.NewRow();
dr["timed"] = DateTime.Parse("2013-9-27 12:00:00");
dt.Rows.Add(dr);
DateTime dd1 = DateTime.Parse("2013-9-26 22:00:00");
DateTime dd2 = DateTime.Parse("2013-9-27 12:00:00");
DataRow[] drs = dt.Select("timed > '" + dd1 + "' and timed <= '" + dd2 + "'");//筛选出 2013-9-27 12:00:00