How to filter data between two datetime. Here i am filtering the text file length in a directory..I need to filter text file between the selected date.
DateTime startDate = dateTimePicker1.Value;
DateTime endDate = dateTimePicker2.Value;
var queryList1Only = from i in di.GetFiles("*.txt", SearchOption.AllDirectories)
select i.Length;
Any suggestion?
Use the Where clause:
Instead of
GetCreationTimeyou could useGetLastWriteTimeorGetLastAccessTime.I’d advise checking out a few examples using the where clause for a full understanding of how it all works here.