Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a parent site X, and three child site A, B and C. There is a list by the name "MyList" in all the list sites.

I want a CAML Query to retrieve the latest ten records,from "MyList"(now ten records should be coming from any of the three sites A, B or C, whichever is the latest)

I have to develop a visual web part in parent site X, to display those ten records.

Learned developers....Please help with this complicated CAML query situation

share|improve this question

2 Answers 2

You could achieve that using SPSiteDataQuery if you have particular list type or list base type.

SPSiteDataQuery can be configured to search in all lists of a particular list type or list base type.

  1. The complete site collection

  2. a particular site and sub-sites

    http://amjadk.wordpress.com/2012/11/03/spsitedataquery-understanding-with-examples-for-sharepoint-2010/

share|improve this answer

You can try to use OOTB content query web part information about : which you can find here

also you can try : using LINQ

Hope this helps!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.