Set up a DataRelation on this field...
http://www.knowdotnet.com/articles/datarelation.html Then when you set the
parent value the child values will be updated accordingly. Typically, you'd
set the autoincrement value to -1 and define a datarelation between the
fields. When the update is submitted, the DB will assign a value to the
negative number since autoincrement fields don't allow negatives. You can
then refresh the dataset with another select statement or specify this
option in the DataAdapter Configuration wizard...it's on by default and all
it does is append an additional Select statement on the end of your inserts.
When the value is updated from the DB, the parent record will be corrected.
then if a relation is set properly, the child values will be set too...now
you can submit the updaate on the child table.
HTH,
Bill
mekim said:
when I insert a new record into a master record - I need to update the new
child record with the autonumbered ID key from the master record
Is there a simple way to do this? I insert the record - then try to find
it - then read the key and that seems silly -