Welcome to MSDN Blogs Sign in | Join | Help

SharePoint : How to retrieve all the properties from a list by using the GetListItems() method.

The example given in the SDK doesnt retrieve all the properties of the list. For e.g., I want to retrieve the file size. This property not found the results returned by the SDK sample. The work around is as follows.

localhost.Lists listService = new localhost.Lists();

listService.Credentials = System.Net.CredentialCache.DefaultCredentials;

XmlDocument xmlDoc = new System.Xml.XmlDocument();

 

//empty view fields

XmlNode ndViewFields = xmlDoc.CreateNode(XmlNodeType.Element,"ViewFields","");

 

//get the items

XmlNode ndListItems = listService.GetListItems("Shared Documents", null, null, ndViewFields, null, null);

//display the node

MessageBox.Show(ndListItems.OuterXml);

 

//The file size property name will be ows_FileSizeDisplay

Published Friday, April 07, 2006 12:28 AM by Karthikeyan
Filed under:

Comments

# Retrieving all properties for a Sharepoint list

Sunday, June 03, 2007 3:33 PM by Miscellaneous Debris

When we call the GetListItems or GetListItemChanges methods in Sharepoint's Lists Web Service, we pass

# Retrieving all properties for a Sharepoint list

Sunday, June 03, 2007 3:33 PM by Miscellaneous Debris

When we call the GetListItems or GetListItemChanges methods in Sharepoint's Lists Web Service, we pass

Anonymous comments are disabled
 
Page view tracker