How to fetch the value of a column from a sharepoint list
How to fetch the value of a column from a Sharepoint list using C# code.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Shuvojit HalderPosted Jan 21, 2016, 8:25 AM
Shweta LodhaPosted Jan 18, 2016, 3:37 AM
May be below snippet taken from MSDN will help you:
using (SPSite siteCol = new SPSite("http://server/sites/Contoso"))
{
using (SPWeb web = siteCol.RootWeb)
{
SPList list = web.GetList("/sites/Contoso/Lists/Books"); SPListItem item = list.GetItemByIdSelectedFields(3, "Title", "ISBN", "Retail_x0020_Price");
String bookISBN = (String)item["ISBN"];
}
}