Here is the example.
SPSiteDataQuery objSPSiteDataQuery;
objSPSiteDataQuery = new SPSiteDataQuery();
objSPSiteDataQuery.Query = strCAMLQuery;
objSPSiteDataQuery.Lists = "
objSPSiteDataQuery.Webs = "
objSPSiteDataQuery.ViewFields = "
if (web.GetSiteData(objSPSiteDataQuery).Rows.Count > 0)
{
dt = web.GetSiteData(objSPSiteDataQuery);
}
Here I have used only one sharepoint list you can specify multiple lists also like below.
objSPSiteDataQuery.Lists="
Hope it will help.
No comments:
Post a Comment