Define your subquery like this:
var subquery = (from p in Parts where p.Id > 1 && p.Id < 100 select p.ID).ToArray();
You want the actual ID, not an anonymous type with the single value of ID.
You shouldn't need the ToArray() part either, and the query should be faster if you define it as
var subquery = from p in Parts where p.Id > 1 && p.Id < 100 select p.ID
so that only one DB call is made instead of two.