1 out of 1 rated this helpful - Rate this topic

SiteData.GetList Method

Windows SharePoint Services 3
Returns metadata from the specified SharePoint list.

Web Service: Site DataWeb Reference: http://<Site>/_vti_bin/SiteData.asmx
[SoapDocumentMethodAttribute("http://schemas.microsoft.com/sharepoint/soap/GetList", RequestNamespace="http://schemas.microsoft.com/sharepoint/soap/", ResponseNamespace="http://schemas.microsoft.com/sharepoint/soap/", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Wrapped)] 
public uint GetList (
	string strListName,
	out _sListMetadata sListMetadata,
	out _sProperty[] vProperties
)

Parameters

strListName

A string that contains either the name of the list or the GUID of the list enclosed in curly braces ({}).

sListMetadata

Returns metadata from the list.

vProperties

Returns an array that contains information about each field in the list, including its name, title, and type.

Return Value

A 32-bit unsigned integer that returns 0 to indicate that the operation has completed.

Returns general information, schema of the fields and access right permissions for a given List.

The following code example displays information about a specified list, including its title and default view URL, but also the title, name, and type of each field in the list. This example assumes the existence of a label within the form of a Windows Application.

Web_Reference_Name.SiteData srvSiteData = new Web_Reference_Name.SiteData();
srvSiteData.Credentials = System.Net.CredentialCache.DefaultCredentials;

Web_Reference_Name._sListMetadata lstMetaData;
Web_Reference_Name._sProperty[] lstFields;

srvSiteData.GetList("List_Title", out lstMetaData, out lstFields);

label1.Text = lstMetaData.Title + " :: " + lstMetaData.DefaultViewUrl + "\n";

foreach (Web_Reference_Name._sProperty field in lstFields)
{
    label1.Text += field.Title + " :: " + field.Name + " :: " + field.Type + "\n";
}

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ