S
STom
I have a table named ProposedCosts and another table named AdditionalCosts.
AdditionalCosts has a foriegn key to the ProposedCostID in the ProposedCost
table.
When I retrieve records out of the database, I use a SQLDAtaAdapter and the
..Fill method to fill a 'ProposedCost' datatable and a 'AdditionalCost'
datatable, both tables are in the same dataset.
From the front end, if I wanted to add a new row to ProposedCost, that isn't
any problem except for the fact that it does not generate a ProposedCostID
(this is an identity key in the database). The problem is that if I want to
create an 'additional cost' record, I have no ProposedCostID.
What is the best way to handle a situation like this?
I thought about going back to the database with the dataset and somehow
adding a row to the datatable that way, but then when I finally do, do an
update, won't it think the row I added is a 'new' row and not an update?
Thanks.
STom
AdditionalCosts has a foriegn key to the ProposedCostID in the ProposedCost
table.
When I retrieve records out of the database, I use a SQLDAtaAdapter and the
..Fill method to fill a 'ProposedCost' datatable and a 'AdditionalCost'
datatable, both tables are in the same dataset.
From the front end, if I wanted to add a new row to ProposedCost, that isn't
any problem except for the fact that it does not generate a ProposedCostID
(this is an identity key in the database). The problem is that if I want to
create an 'additional cost' record, I have no ProposedCostID.
What is the best way to handle a situation like this?
I thought about going back to the database with the dataset and somehow
adding a row to the datatable that way, but then when I finally do, do an
update, won't it think the row I added is a 'new' row and not an update?
Thanks.
STom