Retrieve value from SPFieldMultiLineText field in SharePoint

SPSite site = new SPSite("http://{yoursite}")) 
       { 
         using (SPWeb web = site.OpenWeb()) 
         { 
 
           SPList list = web.Lists["{YourList}"]; 
           SPListItem result = list.GetItemById(1);
SPFieldMultiLineText commentsField = result.Fields.GetField("Comments") as SPFieldMultiLineText; 
 
           string comments = commentsField .GetFieldValueAsText(result["Comments"]); 
           string commentsAsHtml = commentsField .GetFieldValueAsHtml(result["Comments"]); 
}
}

3 thoughts on “Retrieve value from SPFieldMultiLineText field in SharePoint

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.