score:3

Accepted answer

When working with DateTime.Now, you should always store it in a local variable otherwise you can get really nasty bugs from the clock changing between calls:

var now = DateTime.Now;
var query = from v in dc.VisitorInfors
            where v.VisitTime.Date == now.Date
            select v;

score:0

Use DateTime.Now :

DateTime currentDate = DateTime.Now;
var query =    
    from v in dc. VisitorInfors    
    where v.VisitTime == currentDate.Date
    select v;

Related Articles