Solved

i want to find newly added 3 items in sharepoint list using object model ?

Posted on 2011-09-08
3
219 Views
Last Modified: 2012-05-12
Hi Experts,

i want to find newly added 3 items in sharepoint list using object model.
0
Comment
Question by:ramuar1981
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 8

Expert Comment

by:vsudip
ID: 36501604
0
 
LVL 6

Author Comment

by:ramuar1981
ID: 36501854
i want to display newly added items in sharepoint list.
0
 
LVL 18

Accepted Solution

by:
ivan_vagunin earned 500 total points
ID: 36512770
Hi!

You can find new items using SPQuery:

SPList myList = SPContext.Current.Web.Lists["My list"];
SPQuery query = new SPQuery();
query.Query = "<OrderBy><FieldRef Name='Created' Ascending='FALSE' /></OrderBy>";
query.RowLimit = 3;
SPListItemCollection items = myList.GetItems(query);
foreach(SPListItem item in items)
{
    //show item
}
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Note:  There are two main ways to deploy InfoPath forms:  Server-side and directly through the SharePoint site.  Deploying a server-side InfoPath form means the form is approved by the Administrator, thus allowing greater functionality in the form. …
Pimping Sharepoint 2007 without Server-Side Code Part 1 One of my biggest frustrations with Sharepoint 2007 in the corporate world is that while good-intentioned managers lock down the more interesting capabilities of Sharepoint programming in…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question