MClarkCCR
asked on
How do I tell a DataGridView to perform 'CRUD' on Business Object Collection
Hello,
I have a DataGridView that is bound to a collection of custom business objects (Product) via a BindingSource. So far I have been able to display the list of the business objects, but what I don't know how to do is to write the code that would for instance insert a new record into the collection from the DGV or update an edited row so that the changes are persisted in the BO's underlying database. Does anyone have any thoughts on how I might get this done?
Thanks,
Mike C
I have a DataGridView that is bound to a collection of custom business objects (Product) via a BindingSource. So far I have been able to display the list of the business objects, but what I don't know how to do is to write the code that would for instance insert a new record into the collection from the DGV or update an edited row so that the changes are persisted in the BO's underlying database. Does anyone have any thoughts on how I might get this done?
Thanks,
Mike C
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the response. At the moment I've decided just to give into Microsoft and use their dataset designer and typed datasets to data bind all my controls. There are just too many hurdles to jump rolling your own collections and trying to create a business layer, too many at least to be helpful for a small app like mine. I'm a bit more than disappointed, however, as I was hoping to use this app as a good tool for learning how to design software into 3-layers which I could have expanded much easier in the future.
Mike C.