2015-08-26 42 views
-2

我需要過濾DataRowCollection以僅保留包含「02/07/2015」(Linq)的條目?如何使用dateTime列過濾DataRowCollection

I'have這DataRowCollection(規劃項目)

Date     HS MS HE ME 
02/07/2015 00:00:00 8 00 9 00 
02/07/2015 00:00:00 10 00 11 00 
16/07/2015 00:00:00 8 00 9 00 

回答

0
var results = from myRow in listEntries.AsEnumerable() 
         where myRow.Field<DateTime>("Date") == new DateTime(2015, 7, 27) 
         select myRow;