Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. SharePoint
  4. Looping through multiple SPLists

Looping through multiple SPLists

Scheduled Pinned Locked Moved SharePoint
csharpsharepointdatabaselinqcom
3 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    BartvE
    wrote on last edited by
    #1

    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

    B 1 Reply Last reply
    0
    • B BartvE

      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

      B Offline
      B Offline
      BartvE
      wrote on last edited by
      #2

      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

      B 1 Reply Last reply
      0
      • B BartvE

        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

        B Offline
        B Offline
        BartvE
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups