Hi
The problem with ADO.NET, seems to me, it was built thinking on flexibility and not simplicity.
For instance, there is a bug (they say its by design) in SqlClient where default values are not saved on the table, raising an error if the field does not allow Null values. One answer if I recall was that ADO.NET was built as a generic data interface, and Default Values are specific for certain Databases, and may not be the same parameter in diferent databases. How stupid can this be? SQLCLIENT is SPECIFIC to SQL Server... what is the deal here?
Like these, there are a lot of other issues. For instance... try to have a field named USER on your tables, and check the error on updating a record with a datatable or dataset... it just does not give you any clue about the real error... you cant have a field called user (sql automatically converts it to [USER]).
And son on and so on...
What I did was to create a wraper class for ADO.NET. Basically the ideia of this class is to mimic some of the features of ADO. Created a myRecordset, that has the possibility to be Dynamic, ReadOnly or Command.
On top of that, I added functionalities like Recordcount, MoveNext, MovePrevious, MoveFirst and MoveLast. A simple variable with the current row.
Accessing my fields is as simple as doing MyRecordset.Fields("")... etc etc etc
This allowed me to migrate code from VB6 mutch more easily... I just have to make a few changes to the code.
Just my 2 cents. ADO.NET is very flexible, but over-complex for simple tasks.
Best regards,
João Cardoso
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement