[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

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

Posted on 2011-09-08
3
Medium Priority
?
226 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 2000 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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

Microsoft SharePoint Foundation 2010 and Microsoft SharePoint Server 2010 do not offer the option to configure the location of the SharePoint diagnostic trace log files during installation.  This can, however, be configured through Central Administr…
When using a search centre, I'm going to show you how to configure Sharepoint's search to only return results from the current site collection. Very useful when using Office 365 with multiple site collections.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

649 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