Mike Walsh
Guest
|
Posted:
Thu Jan 20, 2005 11:35 pm Post subject:
Re: How to simulate SQL IN syntax in a CAML query |
|
|
Please post this kind of CAML / use of WSS SPQuery class query to the
subnewsgroup for WSS programming at
microsoft.public.sharepoint.windowsservices.development
which has been set up for all kinds of programming questions (Web Services
usage; web part creation and amendment and CAML)
Please also in future only send programming questions there to keep a clear
split betwen the two newsgroups.
Thanks.
Mike Walsh, Helsinki, Finland
WSS FAQ at http://wss.collutions.com
Please reply to the newsgroup
"Bense" <Bense@discussions.microsoft.com> wrote in message
news:3FFEABE5-B6C7-4A93-B2BF-2E1B0A03402F@microsoft.com...
| Quote: | I am trying to use the WSS SPQuery class to select a list of items based on
the Filenames of the documents. However, this query syntax does not work
for
the query text.
The query should simulate a SQL IN statement using OR query syntax.
string sQuery=
"<Where
Or
Eq
FieldRef Name='FileLeafRef'/
Value Type='File'>DocumentStoreAuditFinal.doc</Value
/Eq
Eq><FieldRef Name='FileLeafRef'/
Value Type='File'>DocumentStoreAudit .doc</Value
/Eq
/Or
/Where>";
SPQuery=new SPQuery();
query.Query =sQuery;
SPListItemCollection items = contextDocLibrary.GetItems(query);
I keep getting "Cannot complete this action. Try again." Any pointers to
fix
this would be helpful.
Thanks
|
|
|