Hello everybody my linq to sql selection does not working on dateTime field
for (DateTime i = FromDate; i < DateTime.Now; i = i.AddDays(1))
{
var Count = (from d in db.Users
where d.RegistrationDate.Value == i
select d.ID).Count();
}
i have tried i.date but it does not works too
It looks like you are trying to get a count of all users who registered on a certain day. If so, I think you are best off using the group keyword to group together all users by registration date. You can then create a new anonymous type to contain by the date, and the count, like so: