Thanks for your answer.
1) Unfortunately, AcceptChanges doesn't fix the problem.
1a) ANyway, why would this work when the dataset already contains the
changes, as verified during debugging???
2) Yes, I realize that this is not link, but then again, I was (naively)
thinking that DataContext would have an Update method, but apparently it
doesn't, so at this point I don't have anything that works, Linq or
otherwise.
3) BTW the DataSet has the hierarchical updates member set to true.
JK
"Cowboy (Gregory A. Beamer)" wrote:
You realize what you have here is not LINQ, right?
As for the problem, try firing AcceptChanges on the DataSet prior to firing
off UpdateAll on the TableAdapter.
--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA
Subscribe to my blog
http://feeds.feedburner.com/GregoryBeamer#
or just read it:
http://feeds.feedburner.com/GregoryBeamer
********************************************
| Think outside the box! |
********************************************
"julio" <ju***@discussions.microsoft.comwrote in message
news:F4**********************************@microsof t.com...
I am trying to use Update to save changes made on two DataGridView's to two
tables (Posts & PostDetails) with a FK relationship. I say
private void bUpdate_Click(object sender, EventArgs e) {
try {
CustomerDataSetTableAdapters.TableAdapterManager taManager = new
CustomerDataSetTableAdapters.TableAdapterManager() ;
taManager.PostsTableAdapter = postsTableAdapter;
taManager.PostDetailsTableAdapter = postDetailsTableAdapter;
postsBindingSource.EndEdit();
postsDetailsBindingSource.EndEdit();
taManager.UpdateAll(customerDataSet);
}
catch (System.Exception ex) {
MessageBox.Show(ex.Message.ToString());
}
}
It doesn't work. Note:
1. Changes (just DataGridView edits to existing records) don;t show in the
databse.
2. It doen't raise an exception.
3. CustomerDataSet (in UpdateAll() line) contains the new values.
Can you help?
Thanks