-->

Jul 2, 2014

First vs FirstOrDefault in LINQ

First vs FirstOrDefault in LINQ
S.NoFirstFirstOrDefault
1Gives first record from the collection, if collection doesn't have any object then throws error.FirstOrDefault extension method is used to retrieve the first element from the collection, if not then gives null

Jul 1, 2014

LINQ To SQL and LINQ To Object

LINQ To SQL and LINQ To Object
S.NoLINQ To SQLLINQ To Object
1needs a Data Context object.doesn’t need any intermediate LINQ provider or API.
2returns data of type IQueryable.returns data of type IEnumerable.
3translated to SQL by way of Expression Trees, which allow them to be evaluated as a single unit and translated to the appropriate and optimal SQL statementsdoes not need to be translated.
4translated to SQL calls and executed on the specified database.executed in the local machine memory.

Jun 30, 2014

Last vs LastOrDefault in LINQ

Last vs LastOrDefault in LINQ
S.NoLastLastOrDefaulf
1Last extension method gives last element from the collection. If there is no element in the collection, it throws error.LastOrDefault extension method gives the last element form the collection, if not gives null.

Jun 27, 2014

Constants Vs Read-only

Constants Vs Read-only
S.NoConstantsRead-only
1Constants are dealt with at compile-time.Read-only variables are evaluated at runtime.
2Constants supports value-type variables.Read-only variables can hold reference type variables.
3Constants should be used when it is very unlikely that the value will ever change.Read-only variables should be used when run-time calculation is required.

Jun 25, 2014

Double.Parse Vs ConvertTo.Double

Double.Parse Vs ConvertTo.Double
S.NoParticularsDouble.ParseConvertTo.Double
1thrown errorthrown error.Doen not thrown error,Return O Value.

Jun 24, 2014

Int.Parse Vs Convert.ToInt32

Int.Parse Vs Convert.ToInt32
S.NoParticularsInt.ParseConvert.ToInt32
1thrown errorthrown error.Doen not thrown error,Return O Value.

Jun 23, 2014

Local Temp Table Vs Global Temp Table

Local Temp Table Vs Global Temp Table
S.NoParticularsLocal Temp TableGlobal Temp Table
1AvailableSQL Server session or connection (means single user).all SQL Server sessions or connections (means all the user).
2DeletedThese are automatically deleted when the session that created the tables has been closed.These can be created by any SQL Server connection user and these are automatically deleted when all the SQL Server connections have been closed.
3Stared with signLocal temporary table name is stared with single hash ("#") sign.Global temporary table name is stared with double hash ("##") sign.

Jun 21, 2014

ComboBox vs List Box

ComboBox vs List Box
S.NoParticularsComboBoxListBox
1SelectOne Data.Multiple Data.
2FacilityDrop Down Facility.Drop up and Drop Down Facility.
3Check Boxcan't Use CheckBox.Can use Check Box.

Dynamic vs Anonymous Type

. Dynamic vs Anonymous Type
S.NoParticularsDynamicAnonymous types
1Run timeDynamic types work at run time by late binding of object properties.Anonymous types cause the compile time errors.
2KeywordDynamic KeywordVar Keyword.

Jun 20, 2014

LINQ Vs DLINQ Vs XLINQ

LINQ Vs DLINQ Vs XLINQ
S.NoLINQDLINQXLINQ
1programming model that introduces queries as a first-class concept into any Microsoft .NET language.an extension to Linq that allows querying a database and do object-relational mapping.an extension to Linq that allows querying XML documents, as well as creating or transforming XML.