E
Ed Sutton
I am a DB newbie struggling with the best way to load and save objects
from the database. Advice is much appreciated. My current thoughts:
1 - Iterate through the data base retrieving the data needed to create
the collection of objects. Do the reverse to save.
2 - Make the objects load and save themselves to the data base
3 - Persist the actual objects themselves in the database?
I like the following article that uses attributed programming to persist
the objects.
A Data Access Layer to persist business objects using attributes and
reflection - Part I
http://www.codeproject.com/cs/database/dal1.asp
My target is a C# WinForms app that loads a collection of objects into a
treeView. The user may edit these objects and changes are saved to the
database.
Thanks in advance for any direction or advice,
-Ed
from the database. Advice is much appreciated. My current thoughts:
1 - Iterate through the data base retrieving the data needed to create
the collection of objects. Do the reverse to save.
2 - Make the objects load and save themselves to the data base
3 - Persist the actual objects themselves in the database?
I like the following article that uses attributed programming to persist
the objects.
A Data Access Layer to persist business objects using attributes and
reflection - Part I
http://www.codeproject.com/cs/database/dal1.asp
My target is a C# WinForms app that loads a collection of objects into a
treeView. The user may edit these objects and changes are saved to the
database.
Thanks in advance for any direction or advice,
-Ed