I am having one site collection that has
two sub sites subSite1 and subSite2.
subSite1Having ListEMP_infowith Column nameTitle and Dept.subSite2Having ListDEPT_infowith column nameTitle and Dept_ID.- I want to show List
EMP_infoandDEPT_infoon RootSite Visual Web Part. - I implemented it By using
SPSiteDataQuerywriting two separate queries.
Is it possible to have a single query? If yes, how to write Single query for that?
If there are 1000 sub site and 1000 list with same column name then how to get that 1000 list using single query.
You may use the below code to get the required result:
List template 107- is used for Task Lists. You can get List Template Id for other lists Here
Webs scope is set to Site collection level to get data from root site and sub sites below it.