Monday 3 August 2015

Get items of folder from SarePoint List c#

Below is the code to read items from a specific folder in SharePoint list

            SPList lst = web.GetList("/Lists/ListName");
            SPFolder folder = lst.RootFolder.SubFolders["FolderName"];
            SPQuery query = new SPQuery();
            query.Folder = folder;
            SPListItemCollection itemColl = lst.GetItems(query);

No comments:

Post a Comment