I have this code C# code in a WCF service:
using (DataClasses1DataContext db = new DataClasses1DataContext())
{
var members = from member in db.Stops_edited_smalls.Take(25)
where Math.Abs(Convert.ToDouble(member.Latitude) - curLatitude) < 0.05
&& Math.Abs(Convert.ToDouble(member.Longitude) - curLongitude) < 0.05
select member;
return members.ToList();
}
Having the :
.Take(25)
as above, returns no retults. Why so? (it works fine without the .Take(25))
Because you’re taking the first 25 before the filtering on the where clause rather than after. None of those 25 records matches the where clause.
If you only want the first 25 results, you should move the call to Take():