Re: Updating Parent and Child at same time
From: Sahil Malik (contactmethrumyblog_at_nospam.com)
Date: 10/26/04
- Next message: Tommy: "Update rows in datatable"
- Previous message: Sahil Malik: "Re: Send updates and deletions to sql all at once?"
- In reply to: SouthSpawn: "Updating Parent and Child at same time"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 26 Oct 2004 13:52:59 -0400
There is more to this problem than meets the eye.
First the simple answer(s) -
a) You can use ADO.NET transactions.
b) You can use database transactions.
c) Sql Server specific: You can pass in XML update grams directly from the
dataset to the stored procedure and have this change applied in one shot.
(Explained in my book - Chapter #12)
Now for the complex part --
For a dataset that has multiple parent/child relations, getting the changed
rows, and applying them properly in sequence is a royal pain in the butt.
But hey atleast in ADO.NET it is possible to deal with multi dimensional
data. For more on this - David Sceppa's ADO.NET book.
- Sahil Malik
http://dotnetjunkies.com/weblog/sahilmalik
Please reply to the newsgroups instead of email so everyone can benefit from
your reply.
"SouthSpawn" <southspawn@aol.com> wrote in message
news:9ba53d6ad8f81d9426dd8ebcc65ae459@localhost.talkaboutsoftware.com...
> Hello Everyone,
>
> I have a quick question.
>
> Let's say you have the following situation. You have a parent table and a
> child table. If I wanted to update both parent and child at the same time.
> What would be the best way to do this. The reason why I am asking. Doing
> two different inserts might be a bad idea. The reason being, what is the
> first insert works, and the second one fail. If you have any suggestions
> that would be great.
>
> Thanks,
> Mark
>
- Next message: Tommy: "Update rows in datatable"
- Previous message: Sahil Malik: "Re: Send updates and deletions to sql all at once?"
- In reply to: SouthSpawn: "Updating Parent and Child at same time"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|