Simple mechanism for updating database with data from bound datagrid

G

Greg

I'm using the Framework 1.1, so I don't have access to the new
DataGridView object.

What I'm wondering is, is there a really simple way to bind a plain
datagrid to a database in such a way that changes made to cells in the
datagrid call an update on the corresoonding data within a database?
I've looked in vain for a really simple way to do this with minimal
coding, but I'm coming to the conclusion that I will have to trap the
events of the datagrid and do all the dirty work myself.

Any suggestions would be very appreciated.

Greg.
 
N

Nicholas Paldino [.NET/C# MVP]

Greg,

You are pretty much right. The data model of .NET is a disconnected
one, so if you want to update the database (or know when it is updated), you
will need to put that mechanism in yourself.

As for updating, yes, you will have to determine when the data grid is
changed (you are better off connecting to the dataset itself, and catching
the events on there) and then updating the back end appropriately.

Hope this helps.
 
G

Greg

Nicolas,

Thanks for that - that has saved me a lot of time doing more searching!
I'm not too daunted by the solution - I just needed to check that I
wasn't barking up the wrong tree!

Greg.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top