i use asp.net mvc and c# i have data table that have many column,one column has 'time' and sotred data like this format


in view i have filter for time and user can select multiple time from check box, my filter check box is

4 - 8
8 - 11
11 - 14
14 - 17
17 - 21
21 - 24

now i want filter from datatable

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(); 

my problem is,i dont know user how many pass time , if just passed one time it's easy but i dont know how many time passed

how i can edit code for accept any time and any count of time?

thank you for your help

Related posts

Recent Viewed