Sharepoint client 'List' no extension method 'Items'

Ben Smith 21 Reputation points

I am using the template from the documentation for How to Update List Items on a Sharepoint List using C#. I am using the input rows from a SQL statement source within SSIS.

I have the Microsoft.Sharepoint.Client reference set up. Here is my code

public override void Input0_ProcessInputRow(Input0Buffer Row)
        string siteUrl = "http://MyServer/sites/MySiteCollection";

        ClientContext clientContext = new ClientContext(siteUrl);
        SP.List oList = clientContext.Web.Lists.GetByTitle("Enrollment");

        ListItem oListItem = oList.Items.GetById(Row.ID);

        oListItem["STATUS"] = Row.Status;




But I get the error message on the line ListItem oListItem = oList.Items.GetById(Row.ID);

'List' does not contain a definition for 'Items' and no extension method 'Items' accepting a first argument of type 'List' could be found (are you missing a directive or assembly reference?

I have the namespaces set up correctly

using Microsoft.SharePoint.Client;
using SP = Microsoft.SharePoint.Client;

What am I missing?

A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
6,406 questions
SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
1,941 questions
SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,375 questions
No comments
{count} votes

Accepted answer
  1. sadomovalex 3,601 Reputation points

    according to List class members there is no Items property for List class. However there is List.GetItemById method which does what you need - returns list item with specified id. So your code will look like this:

    var oListItem = oList.GetItemById(Row.ID);  
    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful