Hey,
Newbie in using ADO.NET.
What I do now : I read the database with an OleDbDataReader. For each row I read I make an object (let say Person + that object contains a collection with the addresses etc.). All the objects I put in a collection called ‘Persons’.
Then I work on that collection (delete, update, add). Each object in the collection contains a state (Add, Update or deleted state).
At the end I want to go back to the database.
What is a best practice to do this?
- Do I pump my collection ‘Persons’ in a dataset, and for each row I set the datarowstate (= state of each object in my collection). I don’t know if this is possible. And then I do dataset.Update and Dataset.Acceptchanges?? Is that not too much (collection to dataset, dataset to database)??
- I cannot use the SQLCommandBuilder because I need joins. What do I have to use if I will update the database???
Thanks in advance.