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.
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Shweta LodhaRank #31 · 39.8K reputationPosted Jan 17, 2016, 10:37 PM EST
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"];
}
}
Shuvojit HalderRank #2,827 · 503 reputationPosted Jan 21, 2016, 3:25 AM EST