Dataset vs. LINQ to SQL

  • Thread starter Thread starter Luigi
  • Start date Start date
L

Luigi

Hi all,
which are the difference (Pro & Cons) between the datasets (ASP.NET 1.X/2.0)
and LINQ to SQL?
Why a few people conside dataset so wrong?

Thanks in advance.
 
Luigi said:
Hi all,
which are the difference (Pro & Cons) between the datasets (ASP.NET
1.X/2.0)
and LINQ to SQL?

This is a very deep subject and will largely be answered based on bias
rather than facts, if history holds.

LINQ to SQL is more flexible, if you are working with LINQ "objects". The
SQL like syntax makes working with the objects easier. In addition, it is
quite easy to move subsets to another collection of objects without the
DataSet "row already belongs to" issues.As data access, it generally sucks,
as you end up with open contexts, which is not great for ASP.NET.

DataSets are okay containers, IMO. They are quite easy to work with. There
are some potential performance issues.

For SOA implementations, LINQ to SQL objects add some extra FUD that does
not translate well to other platforms (these are fields added for
relationships). If you are purely .NET, there is no issue. The exception is
one table per DBML, which I blogged about (R&D project, not a
recommendation). The Entity Framework (3.5 SP1) is even worse in this area,
as relationships become their own object. DataSets, on the other hand, are
easy enough to repro in other languages.
Why a few people conside dataset so wrong?

Mostly religious reasons. ;-)

The DataSet has a bit of weight to it, especially if you have altered data.
I am not sure it is a really big deal, but so many developers are focused on
microseconds and the perf of a DataSet is not as good as LINQ, et al.

Either is simple enough to use some drag and drop to set things up.

I would look at your reqs, both short and long term, and make a decision.
Considering MS has invested a lot in LINQ, I would probably start weighted
towards LINQ over DataSets, but if you find DataSets work for you, are
simpler to develop for this app, and fulfill the long-term requirements, I
see no problems. LINQians will religiously disagree with me. ;-)

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://feeds.feedburner.com/GregoryBeamer#

or just read it:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think outside the box! |
********************************************
 
Back
Top