我在 Windows 应用程序中有网格视图。现在我想将共享文档字段值显示到网格视图中。任何人都可以有解决方案吗????
IEnumerable<Sp.ListItem> list;
Sp.ClientContext spcontext = new ClientContext("http://Sharepointsite");
Sp.Web spsite = spcontext.Web;
Sp.ListCollection lcollection = spsite.Lists;
var productlist = spcontext.Web.Lists.GetByTitle("Shared Documents/Photo");
Sp.CamlQuery cm = new CamlQuery();
IQueryable<Sp.ListItem> mylist = productlist.GetItems(cm);
list = spcontext.LoadQuery(mylist);
spcontext.ExecuteQuery();
var qry = (from prd in list
select new
{
Name = prd.FieldValues.Values.ElementAt(1).ToString(),
Custom = prd.FieldValues.Values.ElementAt(2).ToString(),
}).ToList();
dataGridView1.DataSource = qry;
错误:Sharepointsite 中 URL 的站点不存在列表“共享文档/照片”