Get items from sharepoint list

private ArrayList GetServerList()
ArrayList sNames = new ArrayList();
Guid id = new Guid(“46089E30-FCD1-45C9-9437-454754C5058D”);
SPSite SiteCol = new SPSite(id);
SPList splist = SiteCol.AllWebs[“”].Lists[“Servers”];

SPQuery oQuery = new SPQuery();
oQuery.Query = “” +
SPListItemCollection listItems = splist.GetItems(oQuery);

foreach (SPListItem listitem in listItems)
//string test = listitem[“ServerName”].ToString();
return sNames;

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.