I'm sure it's something really stupid, but I just don't see it..
pData.LocationHours
is of type BaseLocationHoursDataSet.LocationHoursDataTable
. Yet when I hover the cursor over l
, all I see is "(range variable) TSource l
" - why is that?? Why doesn't linq know what it's dealing with? I try the same thing with a different DataTable and everything works fine.... not this guy. What could be the problem?
protected ListItem[] GetHoursTypesListItems(BaseLocationHoursDataSet pData)
{
return (
from l in pData.LocationHours // putting cursor over the l here shows: (range variable) TSource l
select new ListItem
{
Value = l, //ignore the fact that I didn't specify a property - that's the problem, that none of the properties of the object show up.
Text = l
}
).ToArray<ListItem>();
}
.
UPDATE:
The problem is that it doesn't know what l is. Instead of showing me the correct type (I expect to see LocationHoursRow), I see "TSource l".. What is that? Why doesn't it knwo what l is in the "from l in pData.LocationHours
" line?