I am using a WPF datagrid to display my contents in a SQL Server Database. The contents in the datagrid are binded to a view in the database. I populate the datagrid on window loaded by the following:
this.myAccountantDBDataSet = MyAccountant
.MyAccountantDBDataSet(this.FindResource("myAccountantDBDataSet");
// Load data into the table AccountData.
this.accountDataAdapter = new MyAccountant
.MyAccountantDBDataSetTableAdapters.AccountDataTableAdapter();
this.accountDataAdapter.Fill(myAccountantDBDataSet.AccountData);
System.Windows.Data.CollectionViewSource accountDataViewSource =
(System.Windows.Data.CollectionViewSource)
this.FindResource("accountDataViewSource");
accountDataViewSource.View.MoveCurrentToFirst();
What I am wondering, is how to save updates, inserts, and deletions back to the database since what I am showing in the datagrid is a view. The database table and views looks like this:

Updates will work, because the fields in the view map 1:1 to fields in the underlying tables, so Sql Server will be able to resolve updates in the view back to the tables (even
AccountType).Inserts will not work because
Account.AccountTypeIdcan not be set and I assume that it is a mandatory field.Deletes will not work, because Sql Server cannot tell which record in which table you are trying to delete.
I think in this case, you can just as well work with
Accountsrecords and showAccountTypeIdin aDataGridComboBoxColumnthat hasAccountDataas datasource, displaysAccountData.AccountTypeand binds toAccount.AccountTypeId.