SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to with the Object Model query several lists at the same time and get the result merged together? Something like linked sources in SharePoint Designer?

I have created a web part that lists events from a calendar but I want to be able to lists events from several calendars. I know that I can query from different lists and then sort the result myself but this dose not feel optimal.

The best thing would be if I could create the source from SharePoint designer or from SharePoint then add my webpart and then send the "linked source" to my webpart that then would see the data as if it is one list.

share|improve this question
Similar question can be found at… – Jaap Vossers Mar 12 '10 at 16:08

Are you using MOSS or WSS only?

If you have MOSS, have you tried the Content Query Web Part?

If you really need to use the object model, you could try the SPSiteDataQuery class

share|improve this answer

The linked data source in SharePoint Designer uses the AggregateDataSource class.


The above is a collection of DataSource objects.


This is a string similar to this:

<concat name="data source">
    <datasource name="Calendar" id="1" Type="SPList"/>
    <datasource name="Calendar2" id="0" Type="SPList"/>

Using several SPDataSources in the .Sources collection that relate to your calendar lists and an appropriate .Aggregate string should result in the data you want.

share|improve this answer

Your Answer


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