Skip to main content
replaced http://sharepoint.stackexchange.com/ with https://sharepoint.stackexchange.com/
Source Link

You should pass a SPQuery object to the GetItems method. In the query attribute you have to put just the <Query> tag. Use:

SPQUery query = new SPQuery(); query.Query = "" //your <Query>...</Query> tag //for all your view field query.ViewFields ="<FieldRef Name='ID'/>" 

To specify the row limit use:

query.RowLimit = 100; 

To specify the scope:

query.ViewAttributes = "Scope=\"RecursiveAll\"" 

To specify Joins:

query.Joins = ""; 

and

query.ProjectedFields=""; 

Take a look to these links:

JOINS AND PROJECTIONS IN SHAREPOINT 2010
CAML query joinCAML query join

You should pass a SPQuery object to the GetItems method. In the query attribute you have to put just the <Query> tag. Use:

SPQUery query = new SPQuery(); query.Query = "" //your <Query>...</Query> tag //for all your view field query.ViewFields ="<FieldRef Name='ID'/>" 

To specify the row limit use:

query.RowLimit = 100; 

To specify the scope:

query.ViewAttributes = "Scope=\"RecursiveAll\"" 

To specify Joins:

query.Joins = ""; 

and

query.ProjectedFields=""; 

Take a look to these links:

JOINS AND PROJECTIONS IN SHAREPOINT 2010
CAML query join

You should pass a SPQuery object to the GetItems method. In the query attribute you have to put just the <Query> tag. Use:

SPQUery query = new SPQuery(); query.Query = "" //your <Query>...</Query> tag //for all your view field query.ViewFields ="<FieldRef Name='ID'/>" 

To specify the row limit use:

query.RowLimit = 100; 

To specify the scope:

query.ViewAttributes = "Scope=\"RecursiveAll\"" 

To specify Joins:

query.Joins = ""; 

and

query.ProjectedFields=""; 

Take a look to these links:

JOINS AND PROJECTIONS IN SHAREPOINT 2010
CAML query join

Source Link
Nk SP
  • 2.9k
  • 6
  • 40
  • 64

You should pass a SPQuery object to the GetItems method. In the query attribute you have to put just the <Query> tag. Use:

SPQUery query = new SPQuery(); query.Query = "" //your <Query>...</Query> tag //for all your view field query.ViewFields ="<FieldRef Name='ID'/>" 

To specify the row limit use:

query.RowLimit = 100; 

To specify the scope:

query.ViewAttributes = "Scope=\"RecursiveAll\"" 

To specify Joins:

query.Joins = ""; 

and

query.ProjectedFields=""; 

Take a look to these links:

JOINS AND PROJECTIONS IN SHAREPOINT 2010
CAML query join