G
Guest
Hi,
In my application I use typed datasets to persist the user input during the
life of the application until the user submits the data to the db. The
application can open a existing record from the db, add a record via another
source (integrated with another app via xml) or add a new blank record. The
only interaction with the db is at the beginning if opening an exsiting
record or at the end when either updating record or inserting new record.
Basically the application uses the db as a persisting object and nothing
else. The problem I am having is trying to use the dataadapter with the
dataset to update the db. I am trying to understand why do I have to create
3 command objects (update, insert and delete) when I have to insert a new
record? The db structure is similiar to Order-Order Details-Product however
it is more complex (many data relations). Another problem I am having is
there are times when I do not know if this record exists or not because not
always does this record come from the db. So, I do not know if I need to
use the update or insert stored procedure. I thought that the dataadapter
would know when to use either because I submit both commands however this is
not the case. Right it does not work in my testing. It works on the insert
however it does not work if the record already exists. Any ideas?
Thanks
In my application I use typed datasets to persist the user input during the
life of the application until the user submits the data to the db. The
application can open a existing record from the db, add a record via another
source (integrated with another app via xml) or add a new blank record. The
only interaction with the db is at the beginning if opening an exsiting
record or at the end when either updating record or inserting new record.
Basically the application uses the db as a persisting object and nothing
else. The problem I am having is trying to use the dataadapter with the
dataset to update the db. I am trying to understand why do I have to create
3 command objects (update, insert and delete) when I have to insert a new
record? The db structure is similiar to Order-Order Details-Product however
it is more complex (many data relations). Another problem I am having is
there are times when I do not know if this record exists or not because not
always does this record come from the db. So, I do not know if I need to
use the update or insert stored procedure. I thought that the dataadapter
would know when to use either because I submit both commands however this is
not the case. Right it does not work in my testing. It works on the insert
however it does not work if the record already exists. Any ideas?
Thanks