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: [email protected] 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
