SlideShare a Scribd company logo
1 of 3
Download to read offline
1.Difference between LINQ and SQL

       S.No    LINQ                                  SQL

       1       LINQ Stands for language              SQL stands for Structured
               integrated query.                     Query Language.

       2       LINQ Statements are verified          SQL statements can be used in a
               during compile time.                  application gets verified for their
                                                     syntaxes only in the run time.

       3       To use LINQ we can depend upon        To use SQL we need to be familiar
               our .Net Language syntaxes and        with SQL syntaxes and also the pre-
               also we can consume base class        defined functions of SQL like
               library functionalities.              MAX,MIN,LEN and SUBSTRING
                                                      etc...

       4       LINQ Statements can be                As SQL statements execute on
               debugged as they execute under        Database server debugging of the code
               framework environment.                is not possible.
               SQL .

2.Difference between LINQ to SQL and Entity Framework

       S.No    LINQ to SQL                           Entity Framework

       1       It only works with Sql server.        It works with variety of db products.

       2       Used for rapid application            Cannot used for rapid application
               development.                          development.

       3       It does not support for complex       It provides support for complex type.
               type.

       4       It cannot generate db from model.     It can generate db from model.

       5       Mapping type ( class to single        Mapping type ( class to multiple
               table)                                tables)

       6       We can query data using               We can query data using esql,object
               DataContext.                          services,entity client and linq to
                                                     entities.


Another Good Reference:

http://jinaldesai.net/linq-to-sql-vs-entity-framework/

                      (OR)

http://www.slideshare.net/jinaldesailive/linq-to-sql-vs-entity-framework-jinal-desai
3.Difference between LINQ and Stored Procedures


      S.No   LINQ                                  Stored Procedures

      1      As LINQ is part of .NET, we can       It is really very hard to debug the
             use visual studio’s debugger to       Stored Procedure
             debug the queries

      2      With LINQ everything gets             With Stored Procedures, we need to
             complied into single DLL hence        provide an additional script for
             deployment becomes easy.              deployment

      3      LINQ is type safe, so queries         Stored Procedures are not type safe
             errors are type checked at compile    i.e., error can be caught only during
             time.It is really good to encounter   runtime.
             an error when compiling rather
             than runtime exception!

      4      LINQ supports multiple databases      With Stored Procedures which need to
                                                   be re-written for different databases.

      5      LINQ supports abstraction which       As Stored Procedures does not support
             allows framework to add               abstaction , so it is difficult to add
             additional improvements like          additional impovements like multi
             multi threading. It is much           threading
             simpler and easier to add this
             support through LINQ than Stored
             Procedures.

      6      LINQ queries need to compile      Stored Procedures are ster thn LINQ
             before execution.Therefore, LINQ because they are precompiled i.e.,
             is slower than Stored Procedures. Stored Procedures have a predictable
                                               execution plan.Therefore, if a stored
                                               procedure is being executed for the
                                               second time, the database gets the
                                               cached execution plan to execute the
                                               stored procedure.

4.Difference between LINQ to SQL and LINQ to Objects


      S.No   LINQ to SQL                           LINQ to Objects

      1      LINQ to SQL needs a Data          LINQ to Objects does not need any
             Context object. The Data Context intermediate LINQ provider or API.
             object is the bridge between LINQ
             and the database.

      2      LINQ to SQL returns data of type      LINQ to Objects returns data of type
             IQueryable<T>                         IEnumerable<T>.
3      LINQ to SQL is translated to SQL      LINQ to Objects does not need to be
             by way of Expression Trees,           translated.
             which allow them to be evaluated
             as a single unit and translated to
             the appropriate and optimal SQL
             statements.

      4      LINQ to SQL is translated to SQL      LINQ to Objects is executed in the
             calls and executed on the             local machine memory.
             specified database

5.Difference between LINQ to SQL and LINQ to Entities


      S.No   LINQ to SQL                           LINQ to Entities

      1      Does not support Conceptual Data      Supports Conceptual Data Model
             Model

      2      Does not support Storage Schema       Supports Storage Schema

      3      Does not support Mapping Schema       Supports Mapping Schema

      4      Does not support New Data Access      Supports New Data Access Provider
             Provider

      5      Does not support Non-SQL Server       Supports Non-SQL Server Database
             Database Support                      Support

      6      Supports Direct Database              Does not support Direct Database
             Connection                            Connection

      7      Does not support Multiple-table       Supports Multiple-table Inheritance
             Inheritance

      8      Does not support Single Entity from   Supports Single Entity from Multiple
             Multiple Tables                       Tables

More Related Content

Viewers also liked

Viewers also liked (12)

Sql server difference faqs- 7
Sql server difference faqs- 7Sql server difference faqs- 7
Sql server difference faqs- 7
 
Software technology
Software technologySoftware technology
Software technology
 
Asp.net website usage and job trends
Asp.net website usage and job trendsAsp.net website usage and job trends
Asp.net website usage and job trends
 
CSharp difference faqs- 1
CSharp difference faqs- 1CSharp difference faqs- 1
CSharp difference faqs- 1
 
Silverlight difference faqs- 2
Silverlight difference faqs- 2Silverlight difference faqs- 2
Silverlight difference faqs- 2
 
SOA Difference FAQs
SOA Difference FAQsSOA Difference FAQs
SOA Difference FAQs
 
Dotnet difference between questions list- 1
Dotnet difference between questions list- 1Dotnet difference between questions list- 1
Dotnet difference between questions list- 1
 
Sql server difference faqs- 5
Sql server difference faqs-  5Sql server difference faqs-  5
Sql server difference faqs- 5
 
Link checkers 1
Link checkers 1Link checkers 1
Link checkers 1
 
Important Run Commands
Important Run CommandsImportant Run Commands
Important Run Commands
 
Difference between asp.net mvc 3 and asp.net mvc 4
Difference between asp.net mvc 3 and asp.net mvc 4Difference between asp.net mvc 3 and asp.net mvc 4
Difference between asp.net mvc 3 and asp.net mvc 4
 
Difference between asp.net web forms and asp.net mvc
Difference between asp.net web forms and asp.net mvcDifference between asp.net web forms and asp.net mvc
Difference between asp.net web forms and asp.net mvc
 

Similar to Linq difference faqs- 1

Devops Online Training.pdf
Devops Online Training.pdfDevops Online Training.pdf
Devops Online Training.pdf
SpiritsoftsTraining
 
Sql 2012 always on
Sql 2012 always onSql 2012 always on
Sql 2012 always on
dilip nayak
 
Professional sql server 2005 clr programming
Professional sql server 2005 clr programmingProfessional sql server 2005 clr programming
Professional sql server 2005 clr programming
joeljie
 

Similar to Linq difference faqs- 1 (20)

Linq difference faqs- 2
Linq difference faqs-  2Linq difference faqs-  2
Linq difference faqs- 2
 
Linq
LinqLinq
Linq
 
LINQ PPT.pptx
LINQ PPT.pptxLINQ PPT.pptx
LINQ PPT.pptx
 
Linq in C#
Linq in C#Linq in C#
Linq in C#
 
Devops Online Training.pdf
Devops Online Training.pdfDevops Online Training.pdf
Devops Online Training.pdf
 
Devops Online Training.pdf
Devops Online Training.pdfDevops Online Training.pdf
Devops Online Training.pdf
 
Devops Online Training.pdf
Devops Online Training.pdfDevops Online Training.pdf
Devops Online Training.pdf
 
Devops Online Training.pdf
Devops Online Training.pdfDevops Online Training.pdf
Devops Online Training.pdf
 
Devops Online Training.pdf
Devops Online Training.pdfDevops Online Training.pdf
Devops Online Training.pdf
 
NoSql Databases
NoSql DatabasesNoSql Databases
NoSql Databases
 
Java. converted (2)
Java. converted (2)Java. converted (2)
Java. converted (2)
 
Dotnet difference questions & answers Compiled-1
Dotnet difference questions & answers Compiled-1Dotnet difference questions & answers Compiled-1
Dotnet difference questions & answers Compiled-1
 
스프링 프레임워크
스프링 프레임워크스프링 프레임워크
스프링 프레임워크
 
MVC + ORM (with project implementation)
MVC + ORM (with project implementation)MVC + ORM (with project implementation)
MVC + ORM (with project implementation)
 
Sql 2012 always on
Sql 2012 always onSql 2012 always on
Sql 2012 always on
 
Linq to sql
Linq to sqlLinq to sql
Linq to sql
 
Professional sql server 2005 clr programming
Professional sql server 2005 clr programmingProfessional sql server 2005 clr programming
Professional sql server 2005 clr programming
 
KnowItPresentation
KnowItPresentationKnowItPresentation
KnowItPresentation
 
Database CI/CD Pipeline
Database CI/CD PipelineDatabase CI/CD Pipeline
Database CI/CD Pipeline
 
Asp.Net 3.5 Part 2
Asp.Net 3.5 Part 2Asp.Net 3.5 Part 2
Asp.Net 3.5 Part 2
 

More from Umar Ali

More from Umar Ali (20)

Difference between wcf and asp.net web api
Difference between wcf and asp.net web apiDifference between wcf and asp.net web api
Difference between wcf and asp.net web api
 
Difference between ActionResult() and ViewResult()
Difference between ActionResult() and ViewResult()Difference between ActionResult() and ViewResult()
Difference between ActionResult() and ViewResult()
 
Difference between asp.net web api and asp.net mvc
Difference between asp.net web api and asp.net mvcDifference between asp.net web api and asp.net mvc
Difference between asp.net web api and asp.net mvc
 
ASP.NET MVC difference between questions list 1
ASP.NET MVC difference between questions list 1ASP.NET MVC difference between questions list 1
ASP.NET MVC difference between questions list 1
 
Affiliate Networks Sites-1
Affiliate Networks Sites-1Affiliate Networks Sites-1
Affiliate Networks Sites-1
 
Technical Video Training Sites- 1
Technical Video Training Sites- 1Technical Video Training Sites- 1
Technical Video Training Sites- 1
 
US News Sites- 1
US News Sites- 1 US News Sites- 1
US News Sites- 1
 
Weak hadiths in tamil
Weak hadiths in tamilWeak hadiths in tamil
Weak hadiths in tamil
 
Bulughul Maram in tamil
Bulughul Maram in tamilBulughul Maram in tamil
Bulughul Maram in tamil
 
Indian news sites- 1
Indian news sites- 1 Indian news sites- 1
Indian news sites- 1
 
Photo sharing sites- 1
Photo sharing sites- 1 Photo sharing sites- 1
Photo sharing sites- 1
 
File hosting search engines
File hosting search enginesFile hosting search engines
File hosting search engines
 
Ajax difference faqs compiled- 1
Ajax difference  faqs compiled- 1Ajax difference  faqs compiled- 1
Ajax difference faqs compiled- 1
 
ADO.NET difference faqs compiled- 1
ADO.NET difference  faqs compiled- 1ADO.NET difference  faqs compiled- 1
ADO.NET difference faqs compiled- 1
 
Dotnet differences compiled -1
Dotnet differences compiled -1Dotnet differences compiled -1
Dotnet differences compiled -1
 
.NET Differences List
.NET Differences List.NET Differences List
.NET Differences List
 
Difference between ajax and silverlight
Difference between ajax and silverlightDifference between ajax and silverlight
Difference between ajax and silverlight
 
Difference between is and as operators in c#
Difference between is and as operators in c#Difference between is and as operators in c#
Difference between is and as operators in c#
 
Difference between c# generics and c++ templates
Difference between c# generics and c++ templatesDifference between c# generics and c++ templates
Difference between c# generics and c++ templates
 
Var vs iEnumerable
Var vs iEnumerableVar vs iEnumerable
Var vs iEnumerable
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Recently uploaded (20)

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 

Linq difference faqs- 1

  • 1. 1.Difference between LINQ and SQL S.No LINQ SQL 1 LINQ Stands for language SQL stands for Structured integrated query. Query Language. 2 LINQ Statements are verified SQL statements can be used in a during compile time. application gets verified for their syntaxes only in the run time. 3 To use LINQ we can depend upon To use SQL we need to be familiar our .Net Language syntaxes and with SQL syntaxes and also the pre- also we can consume base class defined functions of SQL like library functionalities. MAX,MIN,LEN and SUBSTRING etc... 4 LINQ Statements can be As SQL statements execute on debugged as they execute under Database server debugging of the code framework environment. is not possible. SQL . 2.Difference between LINQ to SQL and Entity Framework S.No LINQ to SQL Entity Framework 1 It only works with Sql server. It works with variety of db products. 2 Used for rapid application Cannot used for rapid application development. development. 3 It does not support for complex It provides support for complex type. type. 4 It cannot generate db from model. It can generate db from model. 5 Mapping type ( class to single Mapping type ( class to multiple table) tables) 6 We can query data using We can query data using esql,object DataContext. services,entity client and linq to entities. Another Good Reference: http://jinaldesai.net/linq-to-sql-vs-entity-framework/ (OR) http://www.slideshare.net/jinaldesailive/linq-to-sql-vs-entity-framework-jinal-desai
  • 2. 3.Difference between LINQ and Stored Procedures S.No LINQ Stored Procedures 1 As LINQ is part of .NET, we can It is really very hard to debug the use visual studio’s debugger to Stored Procedure debug the queries 2 With LINQ everything gets With Stored Procedures, we need to complied into single DLL hence provide an additional script for deployment becomes easy. deployment 3 LINQ is type safe, so queries Stored Procedures are not type safe errors are type checked at compile i.e., error can be caught only during time.It is really good to encounter runtime. an error when compiling rather than runtime exception! 4 LINQ supports multiple databases With Stored Procedures which need to be re-written for different databases. 5 LINQ supports abstraction which As Stored Procedures does not support allows framework to add abstaction , so it is difficult to add additional improvements like additional impovements like multi multi threading. It is much threading simpler and easier to add this support through LINQ than Stored Procedures. 6 LINQ queries need to compile Stored Procedures are ster thn LINQ before execution.Therefore, LINQ because they are precompiled i.e., is slower than Stored Procedures. Stored Procedures have a predictable execution plan.Therefore, if a stored procedure is being executed for the second time, the database gets the cached execution plan to execute the stored procedure. 4.Difference between LINQ to SQL and LINQ to Objects S.No LINQ to SQL LINQ to Objects 1 LINQ to SQL needs a Data LINQ to Objects does not need any Context object. The Data Context intermediate LINQ provider or API. object is the bridge between LINQ and the database. 2 LINQ to SQL returns data of type LINQ to Objects returns data of type IQueryable<T> IEnumerable<T>.
  • 3. 3 LINQ to SQL is translated to SQL LINQ to Objects does not need to be by way of Expression Trees, translated. which allow them to be evaluated as a single unit and translated to the appropriate and optimal SQL statements. 4 LINQ to SQL is translated to SQL LINQ to Objects is executed in the calls and executed on the local machine memory. specified database 5.Difference between LINQ to SQL and LINQ to Entities S.No LINQ to SQL LINQ to Entities 1 Does not support Conceptual Data Supports Conceptual Data Model Model 2 Does not support Storage Schema Supports Storage Schema 3 Does not support Mapping Schema Supports Mapping Schema 4 Does not support New Data Access Supports New Data Access Provider Provider 5 Does not support Non-SQL Server Supports Non-SQL Server Database Database Support Support 6 Supports Direct Database Does not support Direct Database Connection Connection 7 Does not support Multiple-table Supports Multiple-table Inheritance Inheritance 8 Does not support Single Entity from Supports Single Entity from Multiple Multiple Tables Tables