PC Review Forums Newsgroups Microsoft DotNet Microsoft ADO .NET DataSet foreign key update problem

Reply

DataSet foreign key update problem

 
Thread Tools Rate Thread
Old 06-04-2006, 04:13 PM   #1
=?Utf-8?B?SmFtaWUgT2dsZXRob3JwZQ==?=
Guest
 
Posts: n/a
Default DataSet foreign key update problem


I have a strongly typed DataSet with a bunch of tables and relationships. The
relationships reflect the foreign key relationships in the underlying
database.

One of the tables is a join table, linking the others; all of them represent
one logical entity.

When I create new rows in these tables, I set the keys on the records to
negative values, so that I can represent the relationships correctly. I then
use UpdateDataSet to insert the foreign tables, and finally the join table.
As each is inserted, the identity value from the database is correctly set in
the table being added, and in the join table.

Unfortunately the RowState of the join table becomes Unchanged as the other
records are inserted, hence it is not written to the database.

I think this is a bug in .Net 2.0. I can think of many ugly ways around the
problem, but can anybody think of something elegant?
  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off