//得到查阅项的值
SPWeb web = site.OpenWeb();
SPList list = web.Lists["DemoList"];
SPListItem item = list.GetItemById(itemId);
SPFieldLookupValue objLookupFieldValue = new SPFieldLookupValue(item["lookup"].ToString());

//可以得到以下属性
objLookupFieldValue.LookupValue        //得到查阅项的值
objLookupFieldValue.LookupId          //得到或设置查阅项ID

//也可以利用itemID得到查阅项集合
SPFieldLookupValueCollection objLookupFieldValueCol = new              SPFieldLookupValueCollection(item["lookup"].ToString());

for (int i = 0; i < objLookupFieldValueCol.Count; i++)
{
SPFieldLookupValue singlevalue = objLookupFieldValueCol[i];
}

SPFieldLookupValue的更多相关文章

  1. SPFieldLookupValue class

    using System; using Microsoft.SharePoint; namespace ConsoleApp { class Program { static void Main(st ...

  2. 关于在Share point 2010 中保存SPFieldLookupValue类型到一个List中的问题

    在share point 中,有时字段的类型是lookup的,那么将会从另外的一个list中进行相应的连接,这是如果保存string等类型,将会报一个错, Invalid data has been ...

  3. [SharePoint 2010] Copy list item with version history and attachment

    private void MoveItem(SPListItem sourceItem, SPListItem destinationItem) { if (sourceItem == null || ...

  4. SharePoint 2013 列表多表联合查询

    在SharePoint的企业应用中,遇到复杂的逻辑的时候,我们会需要多表查询:SharePoint和Sql数据表一样,也支持多表联合查询,但是不像Sql语句那样简单,需要使用SPQuery的Joins ...

  5. how to get sharepoint lookup value

    SPFieldLookup lookUp1 = properties.ListItem.ParentList.Fields.GetField("Leave_x0020_Type") ...

  6. SharePoint 设置Lookup 字段的值

    如何设置Lookup字段的值, 首先我们同样需要了解SPFieldLookupValueCollection和SPFieldLookupValue, 这2个类的原理和之前所讲解到SPFieldUser ...

  7. SharePoint2010 对象模型 关联列表

    有关列表的创建其实网上已经有很多文章了,其中练习 :利用Visual Studio 2010创建列表这篇文章个人感觉还不错,这里我强调的是对象模型来创建.在这之前我插入一点其他的东东,导入电子表格和数 ...

  8. SharePoint 列表多表联合查询

    在SharePoint平台二次开发中,我们有时需要涉及多表关联查询展示多列表中的不同字段信息:SharePoint和Sql数据表一样,也支持多表联合查询,但是不像Sql语句那样简单,有一定的局限性,需 ...

  9. SharePoint2010QuickFlow安装及使用

    一:QuickFlow的安装 1,从http://quickflow.codeplex.com/下载解决方案包以及设计器. 2,将QuickFlow.dll以及QuickFlow.UI.dll添加到程 ...

随机推荐

  1. zookeeper客户端使用原生JavaApi操作节点

    1.引入依赖 <dependency> <groupId>org.apache.zookeeper</groupId> <artifactId>zook ...

  2. JScrollPane (滚动面板)使用心得

    注意:使用滚动面板时,必须指定内部组件是哪个组件 JScrollPane的两种使用方式:. 方式一: //直接在创建滚动面板对象时,就指定所要显示的组件 //本例中所要显示的是jPanel JPane ...

  3. Ubuntu server 修改系统时区

    执行命令: sudo dpkg-reconfigure tzdata

  4. 修改ssh远程登录配置

    cp /etc/ssh/sshd_config /etc/ssh/sshd_config.ori  #更改配置前进行备份,是vim /etc/ssh/sshd_config  #编辑sshd_conf ...

  5. nginx -s reload "/alidata/server/nginx/logs/nginx.pid" failed

    [root@snoopy :: vhosts]# nginx -s reload nginx: [error] open() : No such file or directory) 修改完nginx ...

  6. 信息领域热词分析系统--python过滤

    利用python过滤去没用的词语,过滤的词语存储在停用文件中. #创建停用词表 def stopwordlist(): stopwords=[line.strip() for line in open ...

  7. java——简易版build模式

    参考教程:https://blog.csdn.net/fanxudonggreat/article/details/78927773 public class Computer { private S ...

  8. SQL 优化通用方法

    1. 尽量避免用sub-queres, 可以采用join代替 2. exists代替in not exists 和not in 这两个的性能值得深究,应该不是差太多 3. 索引优化 4. 一些操作会导 ...

  9. 跨域的问题(jsonp和cors)

    由于浏览器的同源策略,用户想要跨域访问浏览器就会报错,那么就涉及到解决跨域的问题.最近我接触到的解决方法是两个,jsonp和cors. jsonp(json with padding)我们虽然不能直接 ...

  10. [转]显示农历日期的JS

    本文转自:http://blog.sina.com.cn/s/blog_47377e77010009xc.html <!DOCTYPE HTML PUBLIC "-//W3C//DTD ...