tags:

views:

107

answers:

3

what is the difference between LINQ and ADO.net

A: 

I think you probably mean LINQ-to-SQL. ADO.NET is the bare bones of talking to a Database, so you need to set up the DataTables, DataReaders, etc. yourself. This includes iterating through our tables, setting up your connections, transactions, etc.

LINQ-to-SQL is an ORM (Object Relationship Mapper) which allows you to view your data as business objects, instead of collections of data in DataTables. LINQ-to-SQL works with ADO.NET under the hood. Much easier!

LINQ is the expression syntax used by LINQ-to-SQL to query tables, eg

ClientSet.Where(q=>q.ID==1).First();
Program.X
A: 

LINQ to SQL actually stands for LINQ to 'databases that use SQL' or in other words LINQ for the relational data model. LINQ to Entities means LINQ for the Entity-Data-Model which is a kind of a relational++ model.

More info:

http://blogs.microsoft.co.il/blogs/gilf/archive/2008/04/20/linq-to-sql-vs-entity-framework.aspx

Younes
No, Linq to SQL is not for "databases that use SQL". It's for SQL Server only, not other databases. Entity Framework, on the other hand, can work with other DMBS
Thomas Levesque
+1  A: 

Linq is a language feature (Language INtegrated Query) that allows for querying of objects. It is often conflated with Linq to Sql, which is a series of extension methods and other code that allows querying of a Sql Server database using Linq statements.

You can write a Linq provider to query any kind of datasource, for example, there is a Linq to Amazon provider that allows you to retrieve results from Amazon's public API.

ADO.Net is series of technologies for retrieving data, I suggest starting here: http://en.wikipedia.org/wiki/ADO.NET

KevDog