A web part demonstrating different methods for retrieving list data from SharePoint. The results are shown in an SPGridView.
Uses the following query types:
- For loop
- GetListItems from Lists web service
- SPQuery for SPList objects
- SPSiteDataQuery for cross-site list queries
- CrossListQueryInfo for cached cross-site list queries
- PortalSiteMapProvider for SharePoint Server publishing sites only
The aim of this project is to demonstrate the most basic way to use each of the query types available in SharePoint. Possible options are very basic such that they apply to all types of queries. No post-processing of the results is done, showing the raw format of the data.To install and use:
- Download, add, and deploy the solution.
- Activate the "Query Demo Web Part" site-level feature.
- Find the web part under the "Demo" category and add it to the page.
- Edit the web part's properties and select the options you wish to see.
- Click OK to make the web part use the changed properties.