void SaveChandes() { IAsyncResult asyncResult = null; try { asyncResult = context.BeginSaveChanges(SaveCallback, null); } catch (Exception ex) { context.CancelRequest(asyncResult); HandleException(ex); } }
private void saveChangesButton_Click(object sender, RoutedEventArgs e) { try { // Start the asynchronous call to save changes. context.BeginSaveChanges(OnSaveChangesCompleted, null); } catch (DataServiceClientException ex) { MessageBox.Show(ex.ToString()); } }