Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 743
  • Last Modified:

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
0
MClarkCCR
Asked:
MClarkCCR
1 Solution
 
Bob LearnedCommented:
I would bind the DataGridView to a BindingList(Of BusinessObject).
0
 
MClarkCCRAuthor Commented:
TheLearnedOne,

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.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now