Click here to Skip to main content
16,015,444 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi,

is there any way that we can get sharepoint list item using caml query?

thanks,

gaurav
Posted

There are numerous ways to do this. CAML is the backbone of SharePoint queries.
If you give more details about your issue perhaps a more specific answer can be given.
 
Share this answer
 
hi,

i missed the whole query.

this is how i implemented it

SPQuery _query = new SPQuery();
_query.Query = "
XML
<OrderBy>
   <FieldRef Name='Created' Ascending='False' />
</OrderBy>
";
_query.RowLimit = 1;

thanks,

Gaurav
 
Share this answer
 
SPQuery _query = new SPQuery();
_query.Query = "<orderby><fieldref name="ID" ascending="False">";
_query.RowLimit = 1;



i got my solution through above code

thanks,

gaurav
 
Share this answer
 
Comments
[no name] 27-Jan-12 14:17pm    
Ridiculous. You haven't used any CAML at all. The object creates defaults when no value is supplied.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900