caml

SQL IN equivalent in CAML

我怕爱的太早我们不能终老 提交于 2019-11-28 20:47:06
Is there a "nice" way to create a CAML query for SharePoint that does something like this? SELECT * FROM table WHERE Id IN (3, 12, ...) Or am I stuck with a nightmare of nested <Or> nodes? EDIT: This was my solution to generate the <Or> nodes. /// Simulates a SQL 'Where In' clause in CAML /// </summary> /// <param name="columnType">Specifies the data type for the value contained by the field.</param> /// <returns>Nested 'Or' elements portion of CAML query</returns> public static string CamlIn<T>(string internalFieldName, string columnType, T[] values) { XDocument doc = new XDocument();

CAML query with nested ANDs and ORs for multiple fields

守給你的承諾、 提交于 2019-11-28 09:38:27
I am working on proof-of-concept code to dynamically generate CAML based on keywords provided to a highly-specific search web service that I am writing. I am not using the SharePoint-provided search web service for this proof. I have done so already for what I am trying to achieve. From all of my research, I cannot find a close example for what I am trying to achieve, which is to check multiple fields for multiple values. Yes, I have looked on SO already for my answer, including this one: Need help on building CAML Query . With that said, if it is possible, how can the following SQL-like query

CAML query that includes folders in result set

梦想的初衷 提交于 2019-11-27 16:19:08
问题 I'm trying to write a CAML query that executes against a specific SPList, scoped to a specific folder, recursive from that point, and returns all ListItems (which meet a criteria) and Folders. Here's the code for the query which seems like it should work (formatted for readability): SPQuery query = new SPQuery(); query.Query = " <Where> <Or> <Contains> <FieldRef Name=\"FileRef\" /> <Value Type=\"Text\">foo</Value> </Contains> <Eq> <FieldRef Name=\"FSObjType\" /> <Value Type=\"Lookup\">1<

SQL IN equivalent in CAML

穿精又带淫゛_ 提交于 2019-11-27 13:10:41
问题 Is there a "nice" way to create a CAML query for SharePoint that does something like this? SELECT * FROM table WHERE Id IN (3, 12, ...) Or am I stuck with a nightmare of nested <Or> nodes? EDIT: This was my solution to generate the <Or> nodes. /// Simulates a SQL 'Where In' clause in CAML /// </summary> /// <param name="columnType">Specifies the data type for the value contained by the field.</param> /// <returns>Nested 'Or' elements portion of CAML query</returns> public static string CamlIn

CAML query with nested ANDs and ORs for multiple fields

人走茶凉 提交于 2019-11-27 03:05:49
问题 I am working on proof-of-concept code to dynamically generate CAML based on keywords provided to a highly-specific search web service that I am writing. I am not using the SharePoint-provided search web service for this proof. I have done so already for what I am trying to achieve. From all of my research, I cannot find a close example for what I am trying to achieve, which is to check multiple fields for multiple values. Yes, I have looked on SO already for my answer, including this one: