【发布时间】:2016-12-13 18:51:28
【问题描述】:
我使用 asp.net mvc 和 c# 我的数据表有很多列,一列有“时间”和类似这种格式的数据
14
16:30
17:05
...
在视图中我有时间过滤器,用户可以从复选框中选择多个时间, 我的过滤器复选框是
4 - 8
8 - 11
11 - 14
14 - 17
17 - 21
21 - 24
现在我想从数据表中过滤
var result = from r in myDataTable.AsEnumerable()
where r.Field<string>("time") // between any passed time,like between 4-8 and 11-14 and 21-24
select r;
DataTable dtResult = result.CopyToDataTable();
我的问题是,我不知道用户通过了多少时间,如果只通过一次很容易但我不知道通过了多少时间
我如何编辑代码以接受任何时间和任何时间?
感谢您的帮助
【问题讨论】:
标签: c# asp.net asp.net-mvc datatable