[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
 [Expand]What's Installed
 [Expand].NET Core 3 Support
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
  [Collapse]Data Grid
   [Expand]Getting Started
   [Expand]Implementation Details
   [Expand]Grid View Data Layout
   [Expand]Binding to Data
   [Expand]Master-Detail Data Representation
   [Expand]Data Editing and Validation
   [Expand]Filtering and Searching
   [Expand]Data Summaries
   [Expand]Paging and Scrolling
   [Expand]Focus, Navigation, Selection
   [Expand]Conditional Formatting
   [Expand]Appearance Customization
   [Expand]MVVM Enhancements
   [Expand]Printing and Exporting
   [Expand]Performance Improvement
   [Expand]Design-Time Features
   [Expand]Visual Elements
   [Expand]End-User Capabilities
    [Collapse]Binding to Data
      How to: Automatically Create Grid Columns
      How to: Bind a Grid to Data (eXpress Persistent Objects)
      How to: Bind a Grid to an MS Access Database
      How to: Bind a Grid to an XML File
      How to: Bind a Grid to an ICollectionView
      How to: Bind the GridControl to XPO
      How to: Apply Data Annotations
      How to: Post Changes to SQL Database
      How to: Display Unbound Data
      How to: Create a Master-Detail Grid
      How to: Bind Card Headers to Data
      How to: Customize Automatically Generated Columns
      How to: Bind the Grid to Columns and Summaries Specified in ViewModel
      How to: Create a Banded View
      How to: Display Data Which is Being Updated on Another Thread
      How to: Use DXGrid in Server Mode with Entity Framework 4.0+
      How to: Activate the Instant Feedback Mode for the Grid Bound to the Entity Framework 4.0 Classes
      How to: Implement the Instant Feedback Mode (XPO)
      How to: Parallelize Data-Intensive Operations On In-Memory Data in Instant Feedback UI Mode
      How to: Speed Up Performance When Using WCF Data Services (OData) in Instant Feedback Mode
    [Expand]Hierarchical Data Presentation
    [Expand]Sorting, Grouping and Filtering
    [Expand]Calculating Summaries
    [Expand]Data Editing and Validation
    [Expand]Focus and Navigation
    [Expand]Styles and Templates
    [Expand]End-User Interaction
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Gantt Control
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

How to: Post Changes to SQL Database

The .Net data model implies that a control bound to a database using DbDataAdapter and DataTable objects does not immediately post changes after they have been made. Instead, changes are accumulated in the DataTable. You have to manually call a specific method to update the database. Changes you made while editing data (adding, deleting or modifying records) are saved in the grid's data source (e.g. DataTable). To post these changes to the database, you should call the data adapter's Update method.

Before calling this method, make sure that the grid control has saved all the changes made to the currently focused row. In this instance, you should call the DataViewBase.CommitEditing method.

This example shows how to post changes to a SQL database. Before data is posted to the database, the DataViewBase.CommitEditing method is called to validate the currently edited row (if any).

Is this topic helpful?​​​​​​​