开发者

SharePoint Web Services Query

Consider the following (working) query. It returns an entire SharePoint row, then I get the value I (really wanted) from the row. How can I return only that value?

var ctx = new webservc.MyDataContext(new Uri("http://uri"));
        ctx.Credentials = CredentialCache.DefaultCredentials;

        var query = from c in ctx.MyList orderby c.ValIWant descending select c;
        foreach (webservc.MyListItem item in query.Take(1))
        {
            return (int)item.ValIWant;
    开发者_运维知识库    }

        return 0;

I tried doing "select c.ValIWant" but I get an exception as a result. I cannot use LINQ stuff such as ".Max()" because SharePoint does not support it in the WCF Web Services, so I'm trying to stick to simple queries like the one I have above.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜