C
Chris Bordeman
Hi all. Using Dot Net 2.0.
I have a typed dataset generated by VS. It contains a parent and a child
table with a relationship set up in the MSSQL database and showing in the
dataset. _Both_ tables have new records that need to be added to database.
I'm able to retrieve the server's autoinc values on the parent table, but I
can't seem to get my data adaper to filter the new autoinc values down to
the foreign key field in the child table.
HOW EXACTLY is this done???
I'm currently doing 3 things:
1. Added an output parameter to the insert command to grab the new autoinc
value and feed it into my autoinc field.
2. Set insertCommand.UpdatedRowSource = UpdateRowSource.Both (figure good
idea to grab it all).
3. Appended " SELECT @" + identityColumn.ColumnName + " = SCOPE_IDENTITY()"
to the insert command.
Does #3 keep the entire column's values from being fed back to the DataTable
row?
Do I need to AcceptChanges?
What about if the operation fails and the transaction is rolled back, how do
I undo changes made to the dataset?
THANKS!!!
Chris B.
I have a typed dataset generated by VS. It contains a parent and a child
table with a relationship set up in the MSSQL database and showing in the
dataset. _Both_ tables have new records that need to be added to database.
I'm able to retrieve the server's autoinc values on the parent table, but I
can't seem to get my data adaper to filter the new autoinc values down to
the foreign key field in the child table.
HOW EXACTLY is this done???
I'm currently doing 3 things:
1. Added an output parameter to the insert command to grab the new autoinc
value and feed it into my autoinc field.
2. Set insertCommand.UpdatedRowSource = UpdateRowSource.Both (figure good
idea to grab it all).
3. Appended " SELECT @" + identityColumn.ColumnName + " = SCOPE_IDENTITY()"
to the insert command.
Does #3 keep the entire column's values from being fed back to the DataTable
row?
Do I need to AcceptChanges?
What about if the operation fails and the transaction is rolled back, how do
I undo changes made to the dataset?
THANKS!!!
Chris B.