【发布时间】:2012-01-02 03:15:26
【问题描述】:
我有一个共享点列表,其中包含一些查找字段。当我遍历代码中的项目时,出现以下错误:
对象引用未设置为对象的实例。
此错误仅出现在未填写任何值的查找字段上。我尝试使用SPFieldLookupValue 来检查空值,但我仍然收到错误。
这就是我检查空值的方式:
SPFieldLookupValue value = new SPFieldLookupValue(listItem[columnDisplayName].ToString());
if (value.LookupValue != null)
有什么帮助吗?
【问题讨论】:
标签: sharepoint sharepoint-2010 sharepoint-2007