安装Microsoft.SharePointOnline.CSOM
1.根据sapno,更新状态
List<ListItem> listAll = new List<ListItem>();
using (ClientContext clientContext = new ClientContext(siteURL))
{
SecureString secureString = new SecureString();
foreach (char c in DecryptAES.Decrypt(password).ToCharArray()) secureString.AppendChar(c);
clientContext.Credentials = new SharePointOnlineCredentials(DecryptAES.Decrypt(username), secureString);
List vendorList = clientContext.Web.Lists.GetByTitle("Information");
CamlQuery camlQuery = new CamlQuery();
foreach (DataRow dr in dt.Rows)
{
string sapno = dr[0] == null ? "" : dr[0].ToString().Trim().Replace("\r\n", "");
if (!string.IsNullOrEmpty(sapno))
{
camlQuery.ViewXml = "<View><Query><Where><Eq><FieldRef Name='SAP_x002d_Code'/><Value Type='Text'>" + sapno + "</Value></Eq></Where></Query></View>";
ListItemCollection listItems = vendorList.GetItems(camlQuery);
clientContext.Load(listItems);
clientContext.ExecuteQuery();