我使用SPFieldUserValue从sharepoint获取用户,该列表有person列。但是我的元数据服务正面临一些问题,它在我的sharepoint站点的导航中显示了错误,如-
“托管元数据服务或连接目前不可用。应用程序池或托管元数据Web服务可能尚未启动。请与管理员联系。”
这与sharepoint的SPFieldUserValue功能有任何联系吗?当我使用这个函数时,我得到的错误是-
值不属于预期范围。
发布于 2016-04-04 10:56:32
我刚刚遇到了一个问题,它导致了价值的例外不属于预期的范围。
我试图获取列表数据并将其放入datatable,而在datatable上,我试图从sharepoint站点获取用户。如果我直接从sharepoint列表中获取数据,那么也没有例外。
因以下原因造成的错误
DataTable dtrqacaml = RQA2list.GetItems(oRQA2Query).GetDataTable();
DataView dtview = new DataView(dtrqacaml);
DataTable dtdistinct = dtview.ToTable(true, "RQA_Manager2");
foreach(DataRow dr in dtdistinct.Rows)
{
SPFieldUserValue userValue = new SPFieldUserValue(SPContext.Current.Web, dr["RQA_Manager2"].ToString());
.
.
}误差解析
foreach (SPListItem li in CClist.Items)
{
SPFieldUserValue userValue = new SPFieldUserValue(SPContext.Current.Web, li["CC_Person"].ToString());
.
.
}https://stackoverflow.com/questions/36352913
复制相似问题