2

I have to get values programmatically from the discussions list. When I tried this code it is giving the values of replies.

SPList oSpListPost = oSPWeb.Lists["Discussions List"];
SPListItemCollection oSpListItemClnPost = oSpListPost.Items;

foreach (SPListItem post in oSpListItemClnPost)
{
       SPField field = post.Fields.GetField("Body");
}
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Roy Justin
  • 653
  • 3
  • 10
  • 23

1 Answers1

0

The "parent" discussion is a folder with attached metadata, not a list item. You will probably want to get the associated folders in the list instead of the individual list items.

Chris Quick
  • 111
  • 1
  • 4