I want to get today's entries using LINQ to SQL. I wrote the code below, but it also returns previous entries.
DateTime todaysDate = DateTime.Now; DateTime yesterdaysDate = DateTime.Now.AddDays(-1); var result = (from a in cxt.visitor.OrderByDescending(n => n.singin) where (a.singin > yesterdaysDate && a.singin <= todaysDate) select new {a.visitorid, a.visitorname, a.visitingperson, a.phonenumber, a.reasonforvisit, a.signature, a.singin });
Could you tell me how to get today's entries just using LINQ to SQL?
c # linq-to-sql
Sravanti
source share