要从表中获取仅适用于今天(或特定日期范围)的行,只需执行此操作即可。这种方法的好处是,它适用于特定日期或日期范围的两种情况。
// specify date range (without time)
DateTime currentDate = System.DateTime.Now.Date;
DateTime nextDate = currentDate.AddDays(1);
var second_data = from b in this.database.table
where b.timeStamp.Value >= currentDate
and b.timeStamp.Value < nextDate
select b;