Accessing last record in a sharepoint list via CAML query

Mehboob Ali picture Mehboob Ali · Nov 4, 2009 · Viewed 9.8k times · Source

i ve some problem in accessing last record from sharepoint list through CAML query,can any one help me in this regrad;i have a sample list called 'MainHeads' which contains the information like HeadID,Category,and headName....

Mehboob Pakistan

Answer

Francisco Aquino picture Francisco Aquino · Dec 8, 2009
<View>
<RowLimit>1</RowLimit>
<Query>
   <OrderBy>
      <FieldRef Name='Created' Ascending='False' />
   </OrderBy>
</Query>
</View>