Tag Info

New answers tagged

1

Ok I got the solution. Apparently, the default format of a DateTime field when returned through CAML only contains the date part. When I do it like this, I get the expected results: Query = "<Where>" + "<And>" + "<And>" + "<And>" + ...


1

As @Evariste and @Eric mentioned in comments: CAML Query is case-insensitive. The solution was to filter the results from SPListItemCollection queryResultItems = docTypeList.GetItems(query); and check for case-sensitive. I created a small method which does this. private SPListItem FindCaseSensitive(string documentType, IEnumerable items) { ...


0

CAML Query cannot retrieve distinct rows. You can weed out duplicate values after applying the query. DataTable dt=new DataTable(); dt.Columns.Add("team"); dt.Columns.Add("created"); dt.Columns.Add("score"); StringBuilder output = new StringBuilder(); using (ClientContext ctx = new ...


0

You can use CAML Query to a certain extend. You'd have to combine it with LINQ. First you need to know all of the teamnames var teamList = SPContext.Current.Web.Lists.TryGetList("TeamList"); var teamItems = teamList.Items; // Get all the team names in the list, but only 1 of each var teamnames = teamItems.Cast<SPListItem>().Select(item => ...


0

You could set the RowLimit property of your SPQuery object. The tag is in the schema definition of a view (direct child of ) and therefore cannot be nested inside a tag.


0

Are you using the server object model? If so, try to use SPMETAL. With this in mind you are able to query your context with Linq. When building large queries i think this is the most useful way.


0

Apart from setting ExpandRecurrence property of SPQuery to true, you also need to specify the DateRangesOverlap in the query to get the recurrence events. Example: SPList list = web.Lists["Company Calendar"]; SPQuery oQuery = new SPQuery(); oQuery.ExpandRecurrence = true; oQuery.Query = ...



Top 50 recent answers are included