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***@discussi ons.microsoft.c omwrote in message
news:F4******** *************** ***********@mic rosoft.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(o bject sender, EventArgs e) {
try {
CustomerDataSet TableAdapters.T ableAdapterMana ger taManager = new
CustomerDataSet TableAdapters.T ableAdapterMana ger();
taManager.Posts TableAdapter = postsTableAdapt er;
taManager.PostD etailsTableAdap ter = postDetailsTabl eAdapter;
postsBindingSou rce.EndEdit();
postsDetailsBin dingSource.EndE dit();
taManager.Updat eAll(customerDa taSet);
}
catch (System.Excepti on ex) {
MessageBox.Show (ex.Message.ToS tring());
}
}
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