gpt4 book ai didi

c# - 如何列出使用 .asmx Web 服务将项目添加到 Sharepoint 列表

转载 作者:太空狗 更新时间:2023-10-30 00:43:23 24 4
gpt4 key购买 nike

我在我的项目中使用了 asmx 网络服务。我想将项目添加到现有的 SharePoint 列表。

   mylist.Url = Url.TrimEnd('/') + "/_vti_bin/lists.asmx";
mylist.UseDefaultCredentials = true;
XmlNode node = mylist.GetList(_listName);

而且我已将我的值存储在 DataTable 中。如何直接从 C# Datatable 向 SharePoint 列表添加数据?还是应该将其转换为 Xml 并添加?

谢谢

最佳答案

看看this page UpdateListItems 的一般用法,尽管它只有更新项目的示例。

然后看this page例如,您需要发送 XML 来创建项而不是更新现有项。

您需要遍历数据表,为要添加的每个项目构建一个 XML 结构,但您随后可以在单个请求中添加它们。

关于c# - 如何列出使用 .asmx Web 服务将项目添加到 Sharepoint 列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11356429/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com