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

Top 5 Contributors of the Month
Gaurav Pal

Home >> Interview Question >> LINQ >> Post New Question Subscribe to Interview Questions

What is the difference between OrderBy() and Sort() method over IList

Posted By :Jean Paul     Posted Date :May 21, 2011    Points :40   Category :LINQ 
OrderBy() sorts and gives the view IEnumerable(). But underlying list is sorted or not changed.

Sort() modifies the underlying list.

You can also find related Interview Question to What is the difference between OrderBy() and Sort() method over IList  below: 

What is the difference between Session.Clear() and Session.RemoveAll() method?

Well, actually there is no difference. Session.RemoveAll() methods internally makes a call to Clear() method only.

Thanks. (More...)

What is difference between TransferRequest and Transfer method?

Transfer: Terminates execution of the current page and starts execution of provided URL.
TransferRequest : Performs an asynchronous execution of the provided URL. (More...)

Main Difference between Method and function?

Method which tied to a class where as function need not to be. In OOPS we can say there is no functions concept because all the method is tied to a class.

Function is available in procedural language, Scripting language that why we say JavaScript function etc. (More...)

What is the difference between method activity and event activity in WorkFlow ?

A method activity is one that performs an action, such as creating or updating a task. An event activity is one that runs in response to an action occurring. (More...)

What is the difference between Convert.toString and .toString()

Just to give an understanding of what the above question means see the below code :-

int val = 0;

We can convert the integer "val" using "val.ToString()" or "Convert.ToString" so what's the difference.

The basic difference between them is "Convert" function handles NULLS while "val.ToString()"
does not.

It will throw a NULL reference exception error. So as good coding practice using "Convert" is always safe. (More...)

What is the difference between Convert.ToString() and .ToString() method.

Have a look at the following program and its output

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ExampleOfString
class Program
static void Main(string[] args)
String UserName = null ;
//Below statement WILL THROW an exception as .ToString() does not handles null values
String strUserId = UserName.ToString();
catch (NullReferenceException ex)
Console.WriteLine("Error:{0}", ex.Message);

//Below statement WILL NOT THROW an exception as convert.tostring handles implicitly
String strUserId = Convert.ToString(UserName);
Console.WriteLine("UserName:{0}", strUserId);
catch (NullReferenceException ex)
Console.WriteLine("Error:{0}", ex.Message);

Below is the output of the console application

Error:Object reference not set to an instance of an object.
Press any key to continue . . .
*/ (More...)

Is the Where() method residing in List class or IList class?

It is an extension method in a static class Enumerable.cs (More...)

What is the difference between method activity and event activity in WorkFlow ?


A method activity is one that performs an action, such as creating or updating a task. An event activity is one that runs in response to an action occurring (More...)

What is The Difference Between Final variable,method,class IN Java.

Final variable - Like Constant.
Final method - Can't overridden.
Final class - Can't Inherited by Any other Class (More...)

What is difference between CreateChildControls and the RenderContents method.

The CreateChildControls method is used to add controls to the WebPart, and the RenderContents method is used to tell the page framework how to render the control into HTML to display on a page. (More...)

What is the difference between convert.to.string and .to.string() method?

Convert function handles nulls while i.string() does not it will throw a null reference exception error. (More...)

Difference Between Delete and Truncate

.Delete table is a logged operation, so the deletion of each row gets logged in the transaction log, which makes it slow.

. Truncate table also deletes all the rows in a table, but it won't log the deletion of each row, instead it logs the de-allocation of the data pages of the table, which makes it faster. Of course, truncate table cannot be rolled back.

. Truncate table is functionally identical to delete statement with no "where clause" both remove all rows in the table. But truncate table is faster and uses fewer system and transaction log resources than delete.

. Truncate table removes all rows from a table, but the table structure and its columns, constraints, indexes etc., remains as it is.

. In truncate table the counter used by an identity column for new rows is reset to the seed for the column.

. If you want to retain the identity counter, use delete statement instead.

. If you want to remove table definition and its data, use the drop table statement.

. You cannot use truncate table on a table referenced by a foreign key constraint; instead, use delete statement without a where clause. Because truncate table is not logged, it cannot activate a trigger.

. Truncate table may not be used on tables participating in an indexed view. (More...)

Difference between assembly manifest & metadata?

assembly manifest - An integral part of every assembly that renders the assembly self-describing. The assembly manifest contains the assembly's metadata. The manifest establishes the assembly identity, specifies the files that make up the assembly implementation, specifies the types and resources that make up the assembly, itemizes the compile-time dependencies on other assemblies, and specifies the set of permissions required for the assembly to run properly. This information is used at run time to resolve references, enforce version binding policy, and validate the integrity of loaded assemblies. The self-describing nature of assemblies also helps makes zero-impact install and XCOPY deployment feasible.

metadata - Information that describes every element managed by the common language runtime: an assembly, loadable file, type, method, and so on. This can include information required for debugging and garbage collection, as well as security attributes, marshaling data, extended class and member definitions, version binding, and other information required by the runtime. (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