I will answer your question based on two assumption.
1.If your table contains non nullable value of
ToDate
column.If so you have to use
ToDate.Value
2.If you concerned only about
Month,Day and Year
values of the
ToDate
column. Not
hour, minute and second
values. If so you can format based on these values.
If we agree on this, the following code will properly select date value from your linq query
var query = from to in ddc.tbl_LeadAssigns
select new { formatedDate = to.ToDate.Month + "/" + to.ToDate.Day + "/" + to.ToDate.Year, to.UserId };
var _tol = from to in query
where to.formatedDate.Equals(DateTime.Now.ToShortDateString())
select to;
foreach (var cnt in _tol)
{
todayCount = todayCount + Convert.ToInt32(cnt.TotalLead);
}
lblToday.Text = todayCount.ToString();
Again there are a lot of assumption that I left, like culture and more.