C
Chris Simmons
I've got an app in C# using SQL as my data provider and I'm trying to
add information into 3 tables where the first is the parent, the
second is it's child and the third is a child to the second table. I
posted a while back asking how to update when they are related in SQL.
I was given three examples and none of them worked.
Here's what I'm doing.
I'm inserting a row into my first table, then inserting multiple rows
in the second table. The examples I was given told me to use negative
values for ID fields within the program and then using the
relationship, update the parent rows, which would bring back the
parent row's ID and the relationship would pass that on to my tables
within the program. The problem is that once the update command is
called through the DataAdapter for the parent table, the row state of
all the rows I have added to the child table becomes unchanged.
Because of this, when I run the update for the second table, it's
child, no rows are added to the SQL table. Why is this happening.
This doesn't make any sense. Why would it change the row state and
then not allow me to use the update function provided by the
DataAdapter to insert those rows to the SQL table?
Thanks in advance,
Chris
add information into 3 tables where the first is the parent, the
second is it's child and the third is a child to the second table. I
posted a while back asking how to update when they are related in SQL.
I was given three examples and none of them worked.
Here's what I'm doing.
I'm inserting a row into my first table, then inserting multiple rows
in the second table. The examples I was given told me to use negative
values for ID fields within the program and then using the
relationship, update the parent rows, which would bring back the
parent row's ID and the relationship would pass that on to my tables
within the program. The problem is that once the update command is
called through the DataAdapter for the parent table, the row state of
all the rows I have added to the child table becomes unchanged.
Because of this, when I run the update for the second table, it's
child, no rows are added to the SQL table. Why is this happening.
This doesn't make any sense. Why would it change the row state and
then not allow me to use the update function provided by the
DataAdapter to insert those rows to the SQL table?
Thanks in advance,
Chris