vb.net - sharepoint caml query isn't working when querying by FileLeafRef -


I want to get a specific item from a list of" page "names in a specific SharePoint site. I only want a query to return specific items related to FileLeafRef, which I ask. I have created a CAML query which I have tested for prosecution on the SP CfL Query Helper Tool, so I think the CAML query is good; I can not understand how to query for items using client references. Here's my current code:

  dim fileLeafRef string = "SomeArbitrarilyNamedThing.aspx" retired clientContext ("http: // myfqdn / newsandmedia / companynews") as new Microsoft.SharePoint.Client.ClientContext ) As the slowed list of the form of the Microsoft.SharePoint.Client.List = clientContext.Web.Lists.GetByTitle ("Page") slow camlQuery New Microsoft.SharePoint.Client.CamlQuery () camlQuery.ViewXml = String.Format (" In the form of lt, the query & gt;  & lt; FieldRef name = "" FileLeafRef "/ & gt; & lt; value type =" "text" "& Gt; {0}  gt; & lt; / Eq & gt; & lt; / where & gt; & lt; / query & gt; ", FileLeafRef) Console.WriteLine (camlQuery.ViewXml) ListItems look Microsoft.SharePoint.Client.ListItemCollection = theList.GetItems (camlQuery) clientContext.Load (thelist) clientContext.Load (ListItems) clientContext.ExecuteQuery ()  

After calling ExecuteQuery, when I put a look at the list of archives, it contains more than one item that I ask. (Specifically it is 15, but the requested file should be the same item with LIFF). ? Can anyone help me by identifying what is wrong with this code?

Thanks

Edit: I have found out since that if I wrap the camlQuery XML with the footage tag, it returns the return list object that I wanted to know why anybody can do those tags in this context, and explain why the query returns 15 instead of initially just 1? Text after "

This is because the customer reference CamlQuery object not only accepts the query, but the whole view . That's why you need to see XML you can find visual element structure.

Maybe it returned 15 items initially because you see XML was wrong. I think all the items in this list have returned. I have seen this behavior before working with the server object model - If your CAML query is incorrect structure or a mistake, all list items are returned

.

Comments