Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Problem with lookup value by CAML query.

$
0
0

I just cannot figure out what is wrong with my code that the query does not filter any item. It returns all items in the list. The RowLimit does work so I know the query is used. I wish someone can point out what is wrong in the query. Many thanks.

SPList tList = cWeb.Lists[listName];

SPQuery LookupQuery =newSPQuery();

//LookupQuery.RowLimit = 5;

LookupQuery.Query ="<Query><Where><Eq><FieldRef Name='ItemStatus' /><Value Type='Text'>New</Value></Eq></Where></Query>";

SPListItemCollection iColl = tList.GetItems(LookupQuery);

int n = iColl.Count;


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>