Monday, June 20, 2016

Get SPListItem ItemsData

using (SPSite siteCol = new SPSite("http://peakfinder"))
    {
        using (SPWeb web = siteCol.RootWeb)
        {
            SPList list = web.GetList("/sites/HR/Lists/Account");

            SPListItem item = list.GetItemByIdSelectedFields(3, "Title", "ISBN", "Retail_x0020_Price");

            String bookISBN = (String)item["ISBN"];
        }
    }

No comments:

Post a Comment