![](/img/trans.png)
[英]How to import a Sharepoint document library into Visual Studio 2010?
[英]How to set lookup field in document library?(sharepoint 2010)
我有一个名为DropOffLibrary的文档库。 我在该库中还有一个查找列ElDocsBatch。 所以我需要设定一个特定的值
SPFieldLookupValue newValue = new SPFieldLookupValue(11,"Account");
此查询字段。
终于我解决了我的问题。=))
SPListCollection collLists = oWeb.Lists; //Get All lists
foreach (SPList oList in collLists)
{
if (oList.BaseType == SPBaseType.DocumentLibrary) //Serach for all Libraries
{
SPDocumentLibrary oDocumentLibrary = (SPDocumentLibrary)oList;
string name = oDocumentLibrary.Title.ToString();
if (name == "LibraryName") //Get library what you need
{
SPListItem row = oDocumentLibrary.Items[i]; //get an element by id in library
SPFieldLookupValue newValue = new SPFieldLookupValue( id , "LookupFieldValue");
row["field_name"] = newValue;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.