It's possible your ASP escapes are being taken literally in the query.

 

You might also variations of:

 

@"<Query><Where><Eq><FieldRef Name='Title' /><Value
Type='Text'>{0}</Value></Eq></Where></Query>";

 

and

 

@'<Query><Where><Eq><FieldRef Name="Title" /><Value
Type="Text">{0}</Value></Eq></Where></Query>';

 

 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Matthew Cosier
Sent: Friday, 6 June 2008 12:27 PM
To: listserver@ozMOSS.com
Subject: RE: [OzMOSS] RE: CAML Query not filtering - Any suggestions

 

Not sure, but maybe remove the <Query> element, probably not needed.
Also feel free to use single quotes instead of doubles to make the code
cleaner.

 

Matthew Cosier
Readify | Dev Centre Lead

M: +61 401 932 250 | E: [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>  Blog: http://cosier.wordpress.com
<http://cosier.wordpress.com/> 

 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Trevor Andrew
Sent: Friday, 6 June 2008 12:22 PM
To: listserver@ozMOSS.com
Subject: [OzMOSS] RE: CAML Query not filtering - Any suggestions

 

Hi All,

 

I have a CAML query, which I'm building in U2U CAML's builder - when I
test it in CAML Builder, it returns the one custom list item I'm
seeking. The CAML generated is shown below:

 

<Query><Where><Eq><FieldRef Name="Title" /><Value
Type="Text">ABC</Value></Eq></Where></Query>

 

But when the query is executed using the following code, I get all of
the items in the list returned:

 

                SPList configurationList =
thisList.ParentWeb.Lists[configurationListName];

                SPQuery getConfigurationValueQuery = new SPQuery();

                queryCAML =

                    @"<Query><Where><Eq><FieldRef Name=""Title""
/><Value Type=""Text"">{0}</Value></Eq></Where></Query>";

                getConfigurationValueQuery.Query =
string.Format(queryCAML, configurationValueName);

                SPListItemCollection configurationValues =
configurationList.GetItems(getConfigurationValueQuery);

 

I've verified that the string format substitutes the correct value into
the CAML query ...

 

Any suggestions kindly welcomed ...

 

Cheers,

Trevor Andrew

 

-------------------------------------------------------------------
OzMOSS.com - to unsubscribe from this list, send a message back to the
list with 'unsubscribe' as the subject.
Powered by mailenable.com 


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

-------------------------------------------------------------------
OzMOSS.com - to unsubscribe from this list, send a message back to the
list with 'unsubscribe' as the subject.
Powered by mailenable.com 



____________________________________________________________________________
This e-mail is intended for the use of the addressed recipient(s) only and may 
contain confidential and privileged information. If you have received this 
message in error, please delete the message and any attachments and copies 
immediately; and notify the sender by return e-mail.

Any views expressed in this message or any attachments are those of the 
individual sender and do not necessarily represent the corporate opinion of the 
Catholic Education Office (CEO), Sydney.

The CEO Privacy Policy is located at http://www.ceo.syd.catholic.edu.au
____________________________________________________________________________



------------------------------------------------------------------- OzMOSS.com 
- to unsubscribe from this list, send a message back to the list with 
'unsubscribe' as the subject.

Powered by mailenable.com

Reply via email to