zoukankan      html  css  js  c++  java
  • SharePoint中删除列表记录

    方法1:

    SPList spListQuestion = spWeb.Lists["Question List"];

    for (int i = spListQuestion.Items.Count - 1; i >= 0; i--)

    { spListQuestion.Items[i].Delete(); }

    方法2:

    SPList spListQuestion = spWeb.Lists["Question List"];

    string sDIDTitle = spListQuestion.Fields["DID"].InternalName;

    SPQuery spQuery = new SPQuery();

    spQuery.Query = "" + "" + spDocItem.ID.ToString() + "";

    SPListItemCollection collListItems = spListQuestion.GetItems(spQuery);

    for (int i = 0; i < collListItems.Count; i++)

    { string ID = collListItems[i]["ID"].ToString();

    SPItem spItem = spListQuestion.GetItemById(Int16.Parse(ID));

    spItem.Delete();

     }

  • 相关阅读:
    css
    js
    css3
    css
    深浅拷贝
    index-数据结构/算法
    es6知识点
    在vscode中配置sass savepath
    计算机基础
    element-ui使用后手记
  • 原文地址:https://www.cnblogs.com/catvi/p/1952948.html
Copyright © 2011-2022 走看看