Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Performing Updates</p> <p>When the user edits the Customers data within the DataGrid, the bound in-memory DataTable is updated accordingly. However, these updates are not automatically written back to the database. It is up to the developer to decide when changes to the DataTable are written back to the database depending on the requirements of the application. For example, in some cases, you might wish to submit a batch of changes via a "Submit" button, or you may wish to have the database updated as the user commits each row edit. In order to support these, the rows that the DataTable contains have a RowState property which indicates whether they contain changes which should be synchronized with the database. The synchronization process is easily achieved via the TableAdapter's Update method. url: <a href="http://www.codeproject.com/KB/WPF/WPFDataGridExamples.aspx" rel="noreferrer">WPF DataGrid examples</a></p> <p>The following example shows how the RowChanged and RowDeleted events can be handled so that changes in the DataTable state are written to the database each time the user changes a row:</p> <pre><code>public CustomerDataProvider() { NorthwindDataSet dataset = new NorthwindDataSet(); adapter = new CustomersTableAdapter(); adapter.Fill(dataset.Customers); dataset.Customers.CustomersRowChanged += new NorthwindDataSet.CustomersRowChangeEventHandler(CustomersRowModified); dataset.Customers.CustomersRowDeleted += new NorthwindDataSet.CustomersRowChangeEventHandler(CustomersRowModified); } void CustomersRowModified(object sender, NorthwindDataSet.CustomersRowChangeEvent e) { adapter.Update(dataset.Customers); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload