Solved

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

Posted on 2011-09-08
3
218 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
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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

I have just recently built a new SharePoint 2007 farm on a complete Windows 2008 R2 server platform and part of my standard build procedure is to implement a warm up routine, usually in the form of a script that is scheduled every morning to launch …
When installing SharePoint 2010 RTM I came across a strange error, I was getting timeouts during the installation. I searched the web and found the best solution to be found here (http://social.msdn.microsoft.com/Forums/en-US/sharepoint2010genera…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

829 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