DomainDataSource.SubmitChanges Method

[WCF RIA Services Version 1 Service Pack 2 is compatible with either .NET framework 4 or .NET Framework 4.5, and with either Silverlight 4 or Silverlight 5.]

Submits the changes for every Entity in the DomainContext.

Namespace:  System.Windows.Controls
Assembly:  System.Windows.Controls.DomainServices (in System.Windows.Controls.DomainServices.dll)

Syntax

'Declaration
Public Sub SubmitChanges
'Usage
Dim instance As DomainDataSource

instance.SubmitChanges()
public void SubmitChanges()
public:
void SubmitChanges()
member SubmitChanges : unit -> unit 
public function SubmitChanges()

Remarks

Changes will be submitted for all entities in the DomainContext, including those that were not loaded through this DomainDataSource. This will also commit a pending Add or Edit transaction on the DataView.

Examples

The following example shows how to call the SubmitChanges method for a DomainDataSource control named employeeDataSource. This example is part of a larger example in the Walkthrough: Taking a Tour of RIA Services topic.

Private Sub approveSabbatical_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)
    Dim luckyEmployee As Employee
    luckyEmployee = dataGrid1.SelectedItem
    luckyEmployee.ApproveSabbatical()
    employeeDataSource.SubmitChanges()
End Sub
private void approveSabbatical_Click(object sender, RoutedEventArgs e)
{
    Employee luckyEmployee = (Employee)(dataGrid1.SelectedItem);
    luckyEmployee.ApproveSabbatical();
    employeeDataSource.SubmitChanges();
}

See Also

Reference

DomainDataSource Class

System.Windows.Controls Namespace

Other Resources

DomainDataSource