dataset, dataview, modifications

A

Ahmed Zammar

I need a bit of a hand here. I was a connection to a live database.
It is being displayed in a data grid
I'm using a dataset to grab the changes.

Once the modifications are done, how do I send all of those changes to the
database.

If you know how to accomplish this, I could really use a hand.

thanks.
 
D

Dmitriy Lapshin [C# / .NET MVP]

Hi,
I was a connection to a live database.

And how did you like it? Just kidding ;-)
Once the modifications are done, how do I send all of those changes to the
database.

You should employ a DataAdapter instance with properly configured
UpdateCommand.
If your data structure is simple, to the best of my knowledge, either the
DataSet
or the DataAdapter (most likely the latter, don't remember who exactly) can
derive
the update command automatically. If it is not, you can create a SqlCommand
or OleDbCommand (depending on the type of the data provider you use)
manually and specify it as the DataAdapter.UpdateCommand.

This command will then be invoked for each modified row when you tell the
DataAdapter to update the data.

P.S. Please refer to ADO .NET documentation for the most detailed and
correct information. I have never used this feature so what is written above
is rather a compilation of what I've read in the docs and books.
 

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