Solved

How do I tell a DataGridView to perform 'CRUD' on Business Object Collection

Posted on 2009-04-06
2
725 Views
Last Modified: 2012-06-21
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
Comment
Question by:MClarkCCR
2 Comments
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
Comment Utility
I would bind the DataGridView to a BindingList(Of BusinessObject).
0
 
LVL 3

Author Comment

by:MClarkCCR
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This video discusses moving either the default database or any database to a new volume.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now