Hi, I'm making a tv guide program and I'm letting the user select a start date and an end date and I need to output all the programmes which fall between those times.
I'm using linq like this to filter the data
var result = from p in programmes
where p.Start_t.TimeOfDay > Start.TimeOfDay && p.End_t.TimeOfDay < End.TimeOfDay
select p;
foreach (Programme p in result)
{
string[] arr = { p.Start_t.TimeOfDay.ToString(), p.End_t.TimeOfDay.ToString(), p.Repeat };
listView1.Items.Add(p.Title).SubItems.AddRange(arr);
}
Start and End are the DateTimes which the user has selected
[img]http://img21.imageshack.us/img21/1961/unledos.png[/img]
As you can see from the image there are some wrong results and i cant work out what i'm doing wrong, most of the results are correct but there are a couple which are wrong.
Thanks