Saving DataGrid changes to database

  • Thread starter Thread starter David K.
  • Start date Start date
D

David K.

Hi all,

I am using a Windows Forms DataGrid control.
I would like to save to database any changes I made directly in the datagrid
control (either adding, changing or deleting), - by using the Update()
adapter method.
Please, let me know if it is possible and how it should be done.

Thanks,
David
 
David,

Well, when you populated the DataSet and attached it to a DataGrid, you
most likely used a DataAdapter. If you have that, then you should be able
to take the data source from the grid, and pass it to the Update method of
the same adapter.

You just have to make sure that you have the DeleteCommand,
InsertCommand, and UpdateCommand properties set to the commands that the
adapter will use to update the data.

Hope this helps.
 
Back
Top