Saturday, February 19, 2011

SPCrossListQuery fails to bring back results

I am calling SPWeb.GetSiteData(anSpCrossListQuery).

It fails to bring back any results or any errors when I call it with an accidental space at the end of the CAML query <Where></Where> clause.

Anyone have an idea why?

From stackoverflow
  • Because SharePoint is intent on making development painful ;)

    Nat : not quite, it *actually* makes development painful :)
  • SharePoint is very picky with CAML queries and gives very unhelpful and sometimes obscure errors. Obviously in this case, a simple String.Trim() will fix the problem.

    Checking your query very carefully and making sure it is well formed has fixed every problem I've had with this.

0 comments:

Post a Comment