Tuesday, November 04, 2008

Get Discussion List Items from SharePoint Discussion Forum

If you are trying to retrieve all the root items of the Discussion List this way , it's not going to work :
SPSite site = new SPSite("Site URL");
SPWeb web = site.OpenWeb();
SPList list1 = web.Lists["DiscussionListName"];

SPListItemCollection coll = list1.Items ;



Well Here is the right way of doing it :-)
SPSite site = new SPSite("Site URL");
SPWeb web = site.OpenWeb();
SPList list1 = web.Lists["DiscussionListName"];
SPListItemCollection coll =list1.Folders ;

1 comment:

Anonymous said...

Thank you! I was going crazy looking for this.

AWS Amplify : Failed to pull sandbox app, reason: unable to get local issuer certificate

Here is the scenario:  You are trying to pull Sandbox app from Amplify and complete data model using the command: amplify pull --sandboxId &...