I am having one site collection that has
two sub sites subSite1
and subSite2
.
subSite1
Having ListEMP_info
with Column nameTitle and Dept
.subSite2
Having ListDEPT_info
with column nameTitle and Dept_ID
.- I want to show List
EMP_info
andDEPT_info
on RootSite Visual Web Part. - I implemented it By using
SPSiteDataQuery
writing 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.