SharePoint Web Service系列: Add或Update其他各种类型的项
发布日期:2021-06-29 03:55:46 浏览次数:4 分类:技术文章

本文共 1162 字,大约阅读时间需要 3 分钟。

在前面,我们讨论了如何。因为User类型多少比较特殊。作为SharePoint Web Service系列讨论的结束,我们将讨论各种其他类型的项如何来写。

在SDK中,有如下的一张表格。我们的写法完全是依托在此基础之上。

Name

Format

Attachments

System.Boolean

Boolean

System.Boolean

Calculated

N/A

Choice

System.String

Computed

N/A

Counter

System.Int32

CrossProjectLink

System.Boolean

Currency

System.Double

DateTime

System.DateTime

GridChoice

System.String

Guid

System.Guid

Integer

System.Int32

Lookup

System.String

MaxItems

System.Int32

ModStat

System.Int32

MultiChoice

System.String

Note

System.String

Number

System.Double

Recurrence

System.Boolean

Text

System.String

Threading

System.String

URL

System.String, System.String

User

System.String

这张表格显示了在WSS中的各种字段类型与.NET中对应的数据类型的对照关系。根据这个,我们就可以方便的写出<Field>元素中的内容了。

比如,我们现在要Add或Update一个URL类型的字段。可以这样书写Field:

<
Field 
Name
="SomeUrl"
>
http://www.example.com, Example
</
Field
>

该例中某列表项的SomeUrl字段是链接类型的,我们要写一个链接到这个字段。该链接的地址为“http://www.example.com”,标题为“Example” 。
注意:对于链接类型的字段,由于标题可以不填。(这样系统会默认以地址的内容作标题,这一点和许多文本编辑器相同。)所以上面的例子也可以这样写:

<
Field 
Name
="SomeUrl"
>
http://www.example.com,
</
Field
>

再如,我们现在要Add或Update一个选项类型的字段。可以这样书写Field:

<
Field 
Name
="Status"
>已完成
</
Field
>

任务列表中的状态字段就是选项类型的,由于其对应的是System.String,所以可以直接这么写。

转载地址:https://blog.csdn.net/zengjibing/article/details/3816321 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:SharePoint Web Service系列:编写自定义SharePoint Web Services之一
下一篇:SharePoint Web Service系列:编写自定义SharePoint Web Services之二

发表评论

最新留言

哈哈,博客排版真的漂亮呢~
[***.90.31.176]2024年04月10日 20时56分30秒

关于作者

    喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!

推荐文章