Sunday, July 5, 2009

SPSiteDataQuery




SPSiteDataQuery Describes a query performed across multiple lists, which may be located in multiple Web sites in the same Web site collection.

You Can query multiple lists/Libraries of same kind for common fields in them. This Query returns a Datatable,which can be used as a source to a Calendar or GridView etc.

Query above will serach all the lists(Specified by Basetype = '0') for column name "EventDate" and value as Today's date. And returns Title , EventDate,Description,ListName(custom field in event List) in a form of a Table.


You can also Specify the List's to search in the scope! You need to provide the Guid of the List for that .



Details: http://blog.thekid.me.uk/archive/2007/02/27/spsitedataquery-samples-for-wss-v3.aspx

No comments:

Post a Comment