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;
oListItem.Update();
clientContext.ExecuteQuery();
}
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?
That got rid of the error that was showing in the script but at runtime I get the message that its missing the assembly reference file
Could not load file or assembly 'Microsoft.SharePoint.Client, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified.
I have the dll for Microsoft.SharePoint.Client in my assembly folder and set up in my references. It doesnt show an error beforehand when the script is in edit mode
That got rid of the error that was showing in the script but at runtime I get the message that its missing the assembly reference file
Could not load file or assembly 'Microsoft.SharePoint.Client, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified.
I have the dll for Microsoft.SharePoint.Client in my assembly folder and set up in my references. It doesnt show an error beforehand when the script is in edit mode