摘要: //得到查阅项的值SPWeb web = site.OpenWeb();SPList list = web.Lists["DemoList"];SPListItem item = list.GetItemById(itemId);SPFieldLookupValue objLookupFieldValue = new SPFieldLookupValue(item["lookup"].ToString());//可以得到以下属性objLookupFieldValue.LookupValue //得到查阅项的值objLookupFieldValue.Loo 阅读全文
posted @ 2013-09-06 16:48 TwinStudio 阅读(349) 评论(0) 推荐(0) 编辑
摘要: 在share point 中,有时字段的类型是lookup的,那么将会从另外的一个list中进行相应的连接,这是如果保存string等类型,将会报一个错,Invalid data has been used to update the list item. The field you are trying to update may be read only.这个错误看起来莫名其妙,但实际上是有一定道理的,因为这个字段可以认为是表外键一样的存在。那应该怎么办呢?这里我写了一个方法:public static SPFieldLookupValue GetLookupFieldFromValue( 阅读全文
posted @ 2013-09-06 16:47 TwinStudio 阅读(195) 评论(0) 推荐(0) 编辑