Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
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