sharepoint - Travese through all webs and intersect lists -


i want traverse through webs , child sites, find lists same name , make intersection of them child list priority , show result in web part in repeater. lists contain title, name, link enter image description here

so far have folowing:

 using (spsite ospsite = new spsite("http://niki/default.aspx"))                 {                      spwebcollection sitewebs = ospsite.allwebs;                     foreach (spweb web in sitewebs)                     {                         web.allowunsafeupdates = true;                         try                         {                             splist list = null;                             try                             {                                 list = web.lists[listname];                             }                             catch { }                              if (list != null)                             {                                  list.enablemoderation = true;                                 splistitemcollection collection = list.getitems(list.defaultview);                                 repeater.datasource = collection;                                 repeater.databind();                                 list.update();                             }                         }                                                 {                             if (web != null)                                 web.dispose();                         }                     } 

the result shows last iteration, , no intersection implemented. have no idea how add 2 splistitemcollection, or there way? thanks.

you can use list store data needed, , can defined data stucture yourself.


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -