Linq hierarchical update w/ TableAdapterManager

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?anVsaW8=?=

    Linq hierarchical update w/ TableAdapterManager

    I am trying to use Update to save changes made on two DataGridView's to two
    tables with a FK relationship. I say

    private void bUpdate_Click(o bject sender, EventArgs e) {
    try {

    CustomerDataSet TableAdapters.T ableAdapterMana ger taManager = new
    CustomerDataSet TableAdapters.T ableAdapterMana ger();
    taManager.Conne ction = postsTableAdapt er.Connection; // or should it be
    // =
    postDetailsTabl eAdapter.Connec tion ??
    taManager.Posts TableAdapter = postsTableAdapt er;
    taManager.PostD etailsTableAdap ter = postDetailsTabl eAdapter;
    taManager.Updat eAll(customerDa taSet);
    }
    catch (System.Excepti on ex) {
    MessageBox.Show (ex.Message.ToS tring());
    }

    }


    It doesn't work (DataGridView changes are not saved to the database. Also:
    it doen't raise an exception).

    Can you help?

    Thanks

Working...