M
Mr Newbie
Drama In The Dataset
by Mr Newbie ( A tale of woe and endurance
------------------------------------------------
I am desperately trying to solve an issue with a dataset so please will
someone at least take a stab at helping me ?
I have narrowed down the problem now, so hopefully it should be less of an
issue to address.
I have two tables and a relation. Master / Details. The relation is set to
maintain referential integrety. OK and the master KEY is set to use
decrementing autoincrement so we can link child and parent on the client
side.
1.) Add a single parent row ( OK )
2.) Add the children, and all of them get -1 as their foreign key ( OK )
3.) run Update on the Parent DataAdapter , single parent row created in SQL
server and retreived @@IDENTITY, (OK ?)
foreign keys are updated to the PK of the Master Row from retreived
@@IDENTITY.
4.) When we check the child rows at this stage their status has been changed
from ADDED to UNCHANGED because of the operation performed with the Parent
DataAdapter.
During stage 3.) The foreign keys are updated in the child table, and I
think the Accept Changes is being called on the child table because of the
relation, although this does not make sense.
Does anyone have any idea if what I am saying is correct and if so, why or
how can I get around it ?
Here's hoping for some help !!
:-D
by Mr Newbie ( A tale of woe and endurance
------------------------------------------------
I am desperately trying to solve an issue with a dataset so please will
someone at least take a stab at helping me ?
I have narrowed down the problem now, so hopefully it should be less of an
issue to address.
I have two tables and a relation. Master / Details. The relation is set to
maintain referential integrety. OK and the master KEY is set to use
decrementing autoincrement so we can link child and parent on the client
side.
1.) Add a single parent row ( OK )
2.) Add the children, and all of them get -1 as their foreign key ( OK )
3.) run Update on the Parent DataAdapter , single parent row created in SQL
server and retreived @@IDENTITY, (OK ?)
foreign keys are updated to the PK of the Master Row from retreived
@@IDENTITY.
4.) When we check the child rows at this stage their status has been changed
from ADDED to UNCHANGED because of the operation performed with the Parent
DataAdapter.
During stage 3.) The foreign keys are updated in the child table, and I
think the Accept Changes is being called on the child table because of the
relation, although this does not make sense.
Does anyone have any idea if what I am saying is correct and if so, why or
how can I get around it ?
Here's hoping for some help !!
:-D