Re: Delphi 8 and ado.net

From: Harry Van Tassell (hairy_at_nada.com)
Date: 02/29/04


Date: Sun, 29 Feb 2004 09:41:56 -0500

Lauchlan M wrote:
>> So true and you have said it very well. It seems to me that
>> traditional Delphi users will likely have lots of preconceived ideas
>> about how it
>> *should* work and little inclination to spend the considerable
>> amount of time and effort to learn how it *actually* works. The
>> result will be a vast amount of frustration and noisy grumbling.
>
> Well, how then does it actually work IYO, and why is it so very
> different to using say ADO in Delphi? Apart from datasets potentially
> having many different result sets / tables in them, and a more
> extensive use of data readers, I have found it much the same as
> Delphi. You still have a connection, you use a data adapter to
> populate a dataset (ok this is slightly different than just using a
> table or dataset component) and you bind it (hook it up) to your grid
> or whatever. It's not very different. I must be missing some big
> philosophical point, so if you could fill me in that would be great!

The Delphi ADO implementation is basically a wrapper around the Recordset
that makes it look like a TDataSet.

Some folks say that the ADO vs. ADO.NET object models share little in common
except for the ADO in their names. To completly fill you in on the
differences would be an almost Herculean task on my part so let me refer you
to two books, "Programming ADO" and "ADO.NET the Core Reference" by David
Sceppa who is my favorite author on this subject.

But so as to not appear as shirking your question, IMO a cursory examination
of ADO's Recordset and ADO.NET's DataSet will begin to highlight the
differences. The Recordset has methods like open, close, save, update,
movefirst, movenext, sort, filter, find, etc none of which does the DataSet
have. Recordsets can be connected or disconnected, the DataSet is always
disconnected and does not communicate with your database.. With ADO you can
have cursors into the database, there are no cursors in ADO.NET.

Quoting from the help file, "The DataSet, which is an in-memory cache of
data retrieved from a data source, is a major component of the ADO.NET
architecture. The DataSet consists of a collection of DataTable objects that
you can relate to each other with DataRelation objects. You can also enforce
data integrity in the DataSet by using the UniqueConstraint and
ForeignKeyConstraint objects."

The data cached in a ADO Recordset is more like that in the ADO.NET
DataTable.

I'll stop here and not try to make "some big philosophical point". If you
believe the two are quite similar object models, so be it. I just hope you
will express that belief when someone complains that with ADO.NET Microsoft
has yet again imposed some new diabolical data access technology.<g>

--Hairy