locked
LINQ2SQL VS LINQ2ENTITY RRS feed

  • Question

  • Hi

    Starting a new application and don't know if I should use linq2sql or linq2entity as they will both be new to me so from that aspect wont make much difference.

    Can anyone list the benefits or give some advice ?

    • Moved by Caillen Wednesday, November 13, 2013 2:11 AM Data Platform question.
    Tuesday, November 12, 2013 6:52 AM

Answers

  • Hi Shane:

    You can read the linq-to-sql VS linq-to-entity

    I prefer the latter, because it directly supports Many-To-Many and it has many other benifits such as "Code-First", "Model First"……But linq-to-sql ONLY supports database first;)


    For Account Validation, please follow "Verify Account+Number" at http://social.msdn.microsoft.com/Forums/en-us/home?forum=reportabug

    For ASP.NET Question, please ask at http://forums.asp.net

    For other questions, you can find a specific forum and then ask at http://stackexchange.com/sites

    Click and Donate at http://www.freerice.com

    • Marked as answer by Fred Bao Wednesday, November 20, 2013 8:07 AM
    Tuesday, November 12, 2013 7:16 AM
  • <copied>

    Can anyone list the benefits or give some advice ?

    <end>

    Linq-2-SQL is dedicated to MS SQL Server only.

    Linq-2-Entities is used by the Object Relational Mapping solution ADO.NET Entity Framework which can be used with many DB providers like MS SQL Server, Oracle, and DB2 just to name a few.

    You should go with the big dog EF which is more powerful than Linq-2-SQL, which has several ways to use EF with a database, like code first or model first approach and some others. 

    Linq-2-SQL only has one approach to use it in code and that's it.

    The link may help you.

    http://www.linqpad.net/

    • Marked as answer by Fred Bao Wednesday, November 20, 2013 8:07 AM
    Tuesday, November 12, 2013 8:21 AM
  • Hi Shane,

    LINQ to SQL only supports 1 to 1 mapping of database tables, views, sprocs and functions available in Microsoft SQL Server. It's a great API to use for quick data access construction to relatively well designed SQL Server databases. LINQ2SQL was first released with C# 3.0 and .Net Framework 3.5.

    LINQ to Entities (ADO.Net Entity Framework) is an ORM (Object Relational Mapper) API which allows for a broad definition of object domain models and their relationships to many different ADO.Net data providers. As such, you can mix and match a number of different database vendors, application servers or protocols to design an aggregated mash-up of objects which are constructed from a variety of tables, sources, services, etc. ADO.Net Framework was released with the .Net Framework 3.5 SP1.

    This is a good introductory article on MSDN: Introducing LINQ to Relational Data

    Hope it will be helpful to you.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Fred Bao Wednesday, November 20, 2013 8:07 AM
    Wednesday, November 13, 2013 5:48 AM

All replies

  • Hi Shane:

    You can read the linq-to-sql VS linq-to-entity

    I prefer the latter, because it directly supports Many-To-Many and it has many other benifits such as "Code-First", "Model First"……But linq-to-sql ONLY supports database first;)


    For Account Validation, please follow "Verify Account+Number" at http://social.msdn.microsoft.com/Forums/en-us/home?forum=reportabug

    For ASP.NET Question, please ask at http://forums.asp.net

    For other questions, you can find a specific forum and then ask at http://stackexchange.com/sites

    Click and Donate at http://www.freerice.com

    • Marked as answer by Fred Bao Wednesday, November 20, 2013 8:07 AM
    Tuesday, November 12, 2013 7:16 AM
  • <copied>

    Can anyone list the benefits or give some advice ?

    <end>

    Linq-2-SQL is dedicated to MS SQL Server only.

    Linq-2-Entities is used by the Object Relational Mapping solution ADO.NET Entity Framework which can be used with many DB providers like MS SQL Server, Oracle, and DB2 just to name a few.

    You should go with the big dog EF which is more powerful than Linq-2-SQL, which has several ways to use EF with a database, like code first or model first approach and some others. 

    Linq-2-SQL only has one approach to use it in code and that's it.

    The link may help you.

    http://www.linqpad.net/

    • Marked as answer by Fred Bao Wednesday, November 20, 2013 8:07 AM
    Tuesday, November 12, 2013 8:21 AM
  • Hi Shane,

    LINQ to SQL only supports 1 to 1 mapping of database tables, views, sprocs and functions available in Microsoft SQL Server. It's a great API to use for quick data access construction to relatively well designed SQL Server databases. LINQ2SQL was first released with C# 3.0 and .Net Framework 3.5.

    LINQ to Entities (ADO.Net Entity Framework) is an ORM (Object Relational Mapper) API which allows for a broad definition of object domain models and their relationships to many different ADO.Net data providers. As such, you can mix and match a number of different database vendors, application servers or protocols to design an aggregated mash-up of objects which are constructed from a variety of tables, sources, services, etc. ADO.Net Framework was released with the .Net Framework 3.5 SP1.

    This is a good introductory article on MSDN: Introducing LINQ to Relational Data

    Hope it will be helpful to you.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Fred Bao Wednesday, November 20, 2013 8:07 AM
    Wednesday, November 13, 2013 5:48 AM