Im trying to get values from "Discussions List", When I tried to get the values of "Body" field from that list its giving only the values of the replies of discussion. I couldn't access the values of the discussions, and also its giving exceptions when I try to get the custom column values.
SPSite oSpSite = SPContext.Current.Site;
SPWeb oSPWeb = oSpSite.OpenWeb();
SPList oSpListPost = oSPWeb.Lists["Discussions List"];
SPListItemCollection oSpListItemClnPost = oSpListPost.Items;
foreach (SPListItem post in oSpListItemClnPost)
{
String synopsis = post["Body"].ToString();
}
This code only giving me the values of the replies of discussions, but I wanted to get the values of the discussions.