.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Interview Question >> .NET Framework >> Post New Question Subscribe to Interview Questions

How to get the sum of last 3 items in a list using Lambda Expressions?

Posted By :Jean Paul     Posted Date :December 05, 2010    Points :15   Category :.NET Framework 
Use

int sum = list.Reverse().Take(3).Sum();

You can also find related Interview Question to How to get the sum of last 3 items in a list using Lambda Expressions?  below: 

How to Update SharePoint List Items without Creating New Versions?

  
SystemUpdate method avoids updating modified and modifier fields.
here is the sample below.
SPSite site = new SPSite("http://mossportal/");
SPWeb web = site.OpenWeb();
SPList leaveslist = web.Lists["My Leaves"];
SPListItem collection = leaveslist.Items[0];
collection["Earned_x0020_Leaves"] = "1";
collection.SystemUpdate(false);
collection.Update(); (More...)

How do you return SharePoint List items using SharePoint web services?

  
In order to retrieve list items from a SharePoint list through Web Services, you should use the lists.asmx web service by establishing a web reference in Visual Studio. The lists.asmx exposes the GetListItems method, which will allow the return of the full content of the list in an XML node. It will take parameters like the GUID of the name of the list you are querying against, the GUID of the view you are going to query, etc.
Side Question: I got asked how I built queries with the lists.asmx web service. In order to build queries with this service, one of the parameters that the GetListItems method exposes is the option to build a CAML query. There are other ways to do this as well, but that was how I answered it. (More...)

When retrieving List items using SharePoint Web Services, how do you specify explicit credentials to be passed to access the list items?

  
In order to specify explicit credentials with a Web Service, you generally instantiate the web service, and then using the credentials properties of the Web Service object you use the System.Net.NetworkCredential class to specify the username, password, and domain that you wish to pass when making the web service call and operations.
(More...)

What is lambda expressions

  
A lambda expression is an unnamed method written in place of delegate instance.It has th following form

(Parameter => expression or state,ent block.
eg: y=>x*x;
(More...)

How to find the index of element using Where() with Lambda Expressions?

  
Use the two argumented Lambda method

Where((i, ix) => i == ix); (More...)

How do you initiate a workflow, which check for a value in all the items of a list

  
Using third party tool called nintex workflow, this can be achived (More...)

How would you retrieve large number of Items form the list ?

  

Ans. To retrieve large number of items with a better performance we can either use SPQuery or PortalSiteMapProvider Class. Read More with Examples
Retrieving large number of Items from sharepoint list (More...)

How do you return SharePoint List items using SharePoint web services?

  
Ans.
In order to retrieve list items from a SharePoint list through Web Services, you should use the lists.asmx web service by establishing a web reference in Visual Studio. The lists.asmx exposes the GetListItems method, which will allow the return of the full content of the list in an XML node. It will take parameters like the GUID of the name of the list you are querying against, the GUID of the view you are going to query, etc. (More...)

List out the areas in which data structures are applied extensively?

  
1.Compiler Design,
2.Operating System,
3.Database Management System,
4.Statistical analysis package,
5.Numerical Analysis,
6.Graphics,
7.Artificial Intelligence,
8.Simulation (More...)

If you are using C language to implement the heterogeneous linked list, what pointer type will you use?

  
The heterogeneous linked list contains different data types in its nodes and we need a link, pointer to connect them. It is not possible to use ordinary pointers for this. So we go for void pointer. Void pointer is capable of storing pointer to any type as it is a generic pointer type. (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.


Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend