Updating Datagridview values into database

前端 未结 2 587
醉话见心
醉话见心 2021-01-13 15:24

I am developing an forms application where user can get tables data from database into gridviewcontrol which is editable so that user can update some data in the grid a

相关标签:
2条回答
  • 2021-01-13 16:01

    If you are using a DataTable as a source to the DataGrid that shouldn't be so hard , you can get the changes in the DataTable using datatable.getchanges() // search for an example in getchanges()

    and then update each row that has changed using the unique key ( i assume you have one ) of the row .

    If you need to know how you update back to the database then you should check msdn for the exact method you have to use , depending of course on the one you used to load the data to the grid .

    0 讨论(0)
  • 2021-01-13 16:18

    Check the links below.

    http://www.codeproject.com/Articles/12846/Auto-Saving-DataGridView-Rows-to-a-SQL-Server-Data

    C# Issue: How do I save changes made in a DataGridView back to the DataTable used?

    WinForms DataGridView - update database

    C# WinForms - how to send updates from DataGridView to DataBase

    Save changes in dataGridView

    0 讨论(0)
提交回复
热议问题