Re: I really hate .NET especially inside Delphi



Ingvar Nilsen wrote:
Nick Hodges (Borland/DTG) wrote:

Ingvar Nilsen wrote:

IDataReader fetches what there is to fetch, then lets you iterate
the contents at your own desired pace.
... in one direction. Without field objects.

Absolutely right. But still I wonder why one cannot move back and forth, since the data
obviously has to be there, inside it, organised in rows, one way or
another.


That would render the whole purpose o a data reader pointless: being a *very* thin layer between the DBMS' cursor implementation and your application.
It doesn't even hold the data for one row, you call GetInt32(4) and he will give you that value using the DBMS' client's API. That way there is no marshaling for values you maybe won't use.
If you want to go that clumsy data driven blabla road, that MS is advertising, you can just use DataSets and DataAdapter. But in that case you won't think about performance anyway, as there isn't any performance using DataSets in .Net, IMO.

ADO.Net is all about being *disconnected*.
- Get some data
- work on it either using DataSet or containers of "real" classes.
- get the Delta
- post it back

A "cursor" is in this case the index of your container. I thought Nick meant it as in the current selected (UI wise) record.
That's why I posted the CurrencyMan snippet. Actually CurrencyManager.Current doesn't do anything else than returning the element at index X in the bound data container.
If the container contains "real" objects, that would be an instance o your class, if it were a DataSet it would be a DataRowView, I guess.
I the current selection in your UI is o no interest, then just work directly on your list. ;-)
.



Relevant Pages

  • Tutorial on Form based Applications.
    ... container. ... Then subject to the menu selection made display the ... appropriate form in the frame, ...
    (comp.lang.java.programmer)
  • Re: YANI: load/transfer command
    ... move stuff from the floor into a container, ... move the stuff in from/out to the floor), or I suppose it could be a little more 'generic' -- when picking stuff up, if you have a container ask whether it should go into main or into the container. ... This would let you move items from container to container, container to floor and floor to container and the container could be on the floor or in the inventory. ... The item selection could be done the same way as the existing container content selection is done. ...
    (rec.games.roguelike.nethack)