I guess this is probably going to be obvious in retrospect but I am finding it very hard to get my head round this.
Basically I just want to use LINQ to Objects to select from a range of objects with a surname property the surnames alphabetically between two surnames e.g. in the list:
Adams Bentham Bickford Gillies Kelly Moore Peters Rutherford Smith Taylor Williams
If you selected from "Kelly" to "Smith" it would return:
Kelly Moore Peters Rutherford Smith
inclusive.
It has to be specific enough that in the case where one were to select Kelly to Smith and there was a Kellerman before and a Smythe after the query would leave those out so LIKE 'K%' and LIKE 'S%' are no good. Besides you'd have to go through all the letters inbetween k and s to get there.
I am likely just being foolish in the way I'm putting the question to Google but no one else seems to have this alphabetic concern. Hope someone can help.
EDIT: So far so good folks. But here's a brainrtwister. We want to set a Maximum number of records returned.
e.g If we ask for Bickford to Rutheerford with a max of 3 we should get back:
Bickford Gillies Kelly
At present we just get three of the names between the goalposts at random.
Any ideas?