G
Guest
Using SQL server2000 VB.Net. I have a parent table that uses an identity
column as its primary key. I also have a child table that uses the identity
to create the relation between the parent & child rows. My form has a grid
with a dataset as its source where these 2 tables are joined with a
relationship. The user can add data to the dataset via the grid. When new
rows are added to the parent table of the data set this identity field is
incremented and i copy it to use for the child row to maintain the relation.
The problem is that the identity that the dataset has generated for the
parent table is not neccisarily the id that the SQL table will generate.
Thus the relation between the 2 talbes is broken. I am using the Update
method of the Data Adapter to add the new rows to SQL Server.
So has anybody found a way to solve this kind of problem or should i be
creating my own Id's that i can control better?
Gary
column as its primary key. I also have a child table that uses the identity
to create the relation between the parent & child rows. My form has a grid
with a dataset as its source where these 2 tables are joined with a
relationship. The user can add data to the dataset via the grid. When new
rows are added to the parent table of the data set this identity field is
incremented and i copy it to use for the child row to maintain the relation.
The problem is that the identity that the dataset has generated for the
parent table is not neccisarily the id that the SQL table will generate.
Thus the relation between the 2 talbes is broken. I am using the Update
method of the Data Adapter to add the new rows to SQL Server.
So has anybody found a way to solve this kind of problem or should i be
creating my own Id's that i can control better?
Gary