HI
I have a array of IDs and I want to have a foreach statement iterate each ID to an LINQ database search. Each ID should be found in the database and be bound to a repeater. All I get is the last search. How do I get all the searches?
Thanks
Herb
Int64[] AnimalIDs = new Int64[] {109, 115, 114,117}; foreach (Int64 items in AnimalIDs) { var QueryList = from PersonX in AHData.Owners join Animalx in AHData.Animals on PersonX.OwnerId equals Animalx.OwnerId where Animalx.AnimalId == items where Animalx.AnimalKind == AnimalType select new { Animalx, PersonX, }; foreach (var Personxxx in QueryList) { RepeaterDogList.DataSource = QueryList; RepeaterDogList.DataBind(); } }
="Dogs"; Int64[] AnimalIDs =newInt64[] {109, 115, 114,117}; foreach(Int64items inAnimalIDs) { varQueryList = fromPersonX inAHData.Owners joinAnimalx inAHData.Animals onPersonX.OwnerId equalsAnimalx.OwnerId whereAnimalx.AnimalId ==items whereAnimalx.AnimalKind ==AnimalType selectnew { Animalx, PersonX, }; foreach(varPersonxxx inQueryList) { RepeaterDogList .DataSource =QueryList; RepeaterDogList .DataBind(); } } }
Herb Rabe