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");
}
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.