Re: Delphi 8 and ado.net
From: Xavier Pacheco (Xapware) (xavier_at_spamlessxapware.com)
Date: 03/01/04
- Next message: Craig Stuntz [TeamB]: "Re: Delphi 8 ... is it a worthy investment?"
- Previous message: Eric Grange: "Re: D8 = Disappointment. Is Delphi dead or dying?"
- Maybe in reply to: Alessandro Federici [RemObjects Software]: "Re: Delphi 8 and ado.net"
- Next in thread: Nick Hodges (TeamB): "Re: Delphi 8 and ado.net"
- Reply: Nick Hodges (TeamB): "Re: Delphi 8 and ado.net"
- Reply: Craig Stuntz [TeamB]: "Re: Delphi 8 and ado.net"
- Reply: Dave Johnson: "Re: Delphi 8 and ado.net"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 1 Mar 2004 08:14:05 -0800
Nick Hodges (TeamB) wrote:
> What are the advantages over using Clientdatasets?
To be clear, functionally, everything you can do with a DataSet you can
do with a ClientDataSet. It's not a question of technical capability.
I personally find the the DataSet appraoch far more elegant than I do
the ClientDataSet. DataSet is part of and works well with the FCL, It
is a braindead effort to load all my Lookup Tables in one swoop, cache
them for quick retrieval in an ASP.NET application for retrieveal upon
each page request.
ie: The following can retrieve all 24 of my lookup tables and puts them
in the the Cache:
var
sqlcn: SqlConnection;
sqlDa: SqlDataAdapter;
Ds: DataSet;
begin
sqlcn := SqlConnection.Create(c_cnstr);
sqlDA := SqlDataAdapter.Create('SELECT * from LU_1; SELECT * FROM
LU_2 ...', sqlcn);
Ds := DataSet.Create;
sqlDA.Fill(Ds);
Cache['dsLookups'] := Ds;
sqlcn.Close;
end;
Now to retrieve one of the lookup tables to populate a drop down list
on my web page is a one-liner
SomeLookup.DataSource :=
DataSet(Cache['dsLookups']).Tables['SpecificLookup'];
At design time I would have set up the Data and Value properties for
the lookup.
It simply works natually. Can I do the same with TClientDataSet - of
course its less elegant requires more code and the result does't work
well with the databinding controls (unless I stick to borland's
controls).
I think it's good that folks discuss such differences here, I think it
would be better to illustrate code for both techniques as I feel this
would good for developers. I'm putting together yet another Delphi/.NET
web site that will contain my book examples and I just got the idea to
post the following three items for each of my examples;
The FCL Delphi way
The VCL Delphi way
The C# way
These won't be limited to by book examples so I'm interested in any
ideas.
--- x
------------------------------------
Xapware Technologies Inc.
Manage your projects with
Active! Focus - Get More Done!
www.xapware.com
- Next message: Craig Stuntz [TeamB]: "Re: Delphi 8 ... is it a worthy investment?"
- Previous message: Eric Grange: "Re: D8 = Disappointment. Is Delphi dead or dying?"
- Maybe in reply to: Alessandro Federici [RemObjects Software]: "Re: Delphi 8 and ado.net"
- Next in thread: Nick Hodges (TeamB): "Re: Delphi 8 and ado.net"
- Reply: Nick Hodges (TeamB): "Re: Delphi 8 and ado.net"
- Reply: Craig Stuntz [TeamB]: "Re: Delphi 8 and ado.net"
- Reply: Dave Johnson: "Re: Delphi 8 and ado.net"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|