Looping through multiple SPLists
-
Hello everyone, i'm back :p As my question was answered in the previous post; http://www.codeproject.com/Messages/3354459/SharePoint-employee-database-integration.aspx I continued my project, however at the moment i'm running into problems (mainly performance). Currently what i am trying to do is the following; I have migrated the database to SPLists. What i need to do now is as following. I need to select the sectorname of an employee which is in a totally different SPList (basically i have to loop through 3 other SPLists to get there). Structure": Employee -> Function -> Team -> Sector These above listed are all SPLists with an ID So lets say u have EmployeeID, which is listed in Function In function you have EmployeeID and TeamID Which goes to Team SPList, which has a TeamID and a SectorID And finally Sector has a Name and a ID and i need the name. Yes, i know it's a complicated structure, it works, i can get all data, but since there are quite some items in all the lists, its slow.. I have tried so far; Foreach loops, CAML queries and i'm currently trying LINQ queries, but i'm kind of stuck there. My question really is, is this even remotely doable. Because i think it might be wise to revice the whole database (which would not be prefered at all). Greetings Bart
-
Hello everyone, i'm back :p As my question was answered in the previous post; http://www.codeproject.com/Messages/3354459/SharePoint-employee-database-integration.aspx I continued my project, however at the moment i'm running into problems (mainly performance). Currently what i am trying to do is the following; I have migrated the database to SPLists. What i need to do now is as following. I need to select the sectorname of an employee which is in a totally different SPList (basically i have to loop through 3 other SPLists to get there). Structure": Employee -> Function -> Team -> Sector These above listed are all SPLists with an ID So lets say u have EmployeeID, which is listed in Function In function you have EmployeeID and TeamID Which goes to Team SPList, which has a TeamID and a SectorID And finally Sector has a Name and a ID and i need the name. Yes, i know it's a complicated structure, it works, i can get all data, but since there are quite some items in all the lists, its slow.. I have tried so far; Foreach loops, CAML queries and i'm currently trying LINQ queries, but i'm kind of stuck there. My question really is, is this even remotely doable. Because i think it might be wise to revice the whole database (which would not be prefered at all). Greetings Bart
As an update, i have been fiddling around with SPQuery, which seems ok, performance wise, until i load the full DB to the SPLists (aprox 1000 records per table (SPList). Having to go through that, is impossible, it takes about 10 seconds. Does anyone have any other solution? Thanks in advance! Greetings Bart
-
As an update, i have been fiddling around with SPQuery, which seems ok, performance wise, until i load the full DB to the SPLists (aprox 1000 records per table (SPList). Having to go through that, is impossible, it takes about 10 seconds. Does anyone have any other solution? Thanks in advance! Greetings Bart
For the people that might need to loop through multiple lists, i have a solution. Instead of using the SharePoint API to loop through each SPList induvidually, i added all items within the list to a List. Then i just filtered the data in the list. This boosted the performance from 8-10 sec to load to the page to about 2-4 seconds, which i guess is more acceptable.