I’m using Linq querying today’s date. There is one column in my table called VisitTime which is a Datetime type.
I want to know how to write query statement to search today’s data. Can anyone help me on this?
WebStatDataContext dc = new WebStatDataContext(_connString);
var query=
from v in dc. VisitorInfors
where v.VisitTime......
select v
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: