HighTechTalks DotNet Forums  

How to get the parent of a deleted (child) row

Dotnet Framework (ADO.net) microsoft.public.dotnet.framework.adonet


Discuss How to get the parent of a deleted (child) row in the Dotnet Framework (ADO.net) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
WiZZiX
 
Posts: n/a

Default How to get the parent of a deleted (child) row - 10-22-2004 , 07:17 AM






Hello,

My question is quite straightforward:

How do I get the parent row of a deleted (child) row. If I use the method
"GetParentRow" of the child then it returns "nothing". I have tried using the
version parameter of the method but without any result.

I probably could use the original value of the deleted row to "manually" go
through the parent rows and find its parent but this seems like a lot of work
for something as simple as this.

Hoping for a quick answer,

WiZZiX

Reply With Quote
  #2  
Old   
Miha Markic [MVP C#]
 
Posts: n/a

Default Re: How to get the parent of a deleted (child) row - 10-22-2004 , 09:16 AM






Hi,

I guess you are stuck with manual way.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

"WiZZiX" <wizzix (AT) nospam (DOT) nospam> wrote

Quote:
Hello,

My question is quite straightforward:

How do I get the parent row of a deleted (child) row. If I use the method
"GetParentRow" of the child then it returns "nothing". I have tried using
the
version parameter of the method but without any result.

I probably could use the original value of the deleted row to "manually"
go
through the parent rows and find its parent but this seems like a lot of
work
for something as simple as this.

Hoping for a quick answer,

WiZZiX



Reply With Quote
  #3  
Old   
Sahil Malik
 
Posts: n/a

Default Re: How to get the parent of a deleted (child) row - 10-22-2004 , 10:07 AM



How about dropping down to XML for this? Then using the XMLDOM to find the
relevant row?

- Sahil Malik
http://www.dotnetjunkies.com/weblog/sahilmalik
Please reply to the newsgroups instead of email so everyone can benefit from
your reply.


"Miha Markic [MVP C#]" <miha at rthand com> wrote

Quote:
Hi,

I guess you are stuck with manual way.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

"WiZZiX" <wizzix (AT) nospam (DOT) nospam> wrote in message
newsE17B1E4-F7E8-4BC4-9BA6-3067FE93D9C5 (AT) microsoft (DOT) com...
Hello,

My question is quite straightforward:

How do I get the parent row of a deleted (child) row. If I use the
method
"GetParentRow" of the child then it returns "nothing". I have tried
using
the
version parameter of the method but without any result.

I probably could use the original value of the deleted row to "manually"
go
through the parent rows and find its parent but this seems like a lot of
work
for something as simple as this.

Hoping for a quick answer,

WiZZiX





Reply With Quote
  #4  
Old   
Miha Markic [MVP C#]
 
Posts: n/a

Default Re: How to get the parent of a deleted (child) row - 10-22-2004 , 11:06 AM



Hi Sahil,

Isn't this a bit of an overkill? :-)

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

"Sahil Malik" <contactmethrumyblog (AT) nospam (DOT) com> wrote

Quote:
How about dropping down to XML for this? Then using the XMLDOM to find the
relevant row?

- Sahil Malik
http://www.dotnetjunkies.com/weblog/sahilmalik
Please reply to the newsgroups instead of email so everyone can benefit
from
your reply.


"Miha Markic [MVP C#]" <miha at rthand com> wrote in message
news:%23cyGEIEuEHA.3200 (AT) TK2MSFTNGP14 (DOT) phx.gbl...
Hi,

I guess you are stuck with manual way.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

"WiZZiX" <wizzix (AT) nospam (DOT) nospam> wrote in message
newsE17B1E4-F7E8-4BC4-9BA6-3067FE93D9C5 (AT) microsoft (DOT) com...
Hello,

My question is quite straightforward:

How do I get the parent row of a deleted (child) row. If I use the
method
"GetParentRow" of the child then it returns "nothing". I have tried
using
the
version parameter of the method but without any result.

I probably could use the original value of the deleted row to
"manually"
go
through the parent rows and find its parent but this seems like a lot
of
work
for something as simple as this.

Hoping for a quick answer,

WiZZiX







Reply With Quote
  #5  
Old   
Sahil Malik
 
Posts: n/a

Default Re: How to get the parent of a deleted (child) row - 10-22-2004 , 12:24 PM



Yeah, it might be an overkill .. I was just trying to avoid the string
comparisons on the parent fields. XSLT performance in 2.0 is gonna go up by
400%, so I figured XMLizing your logic wouldn't be so bad.

- Sahil Malik
http://www.dotnetjunkies.com/weblog/sahilmalik
Please reply to the newsgroups instead of email so everyone can benefit from
your reply.


"Miha Markic [MVP C#]" <miha at rthand com> wrote

Quote:
Hi Sahil,

Isn't this a bit of an overkill? :-)

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

"Sahil Malik" <contactmethrumyblog (AT) nospam (DOT) com> wrote in message
news:u8vpbjEuEHA.3200 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
How about dropping down to XML for this? Then using the XMLDOM to find
the
relevant row?

- Sahil Malik
http://www.dotnetjunkies.com/weblog/sahilmalik
Please reply to the newsgroups instead of email so everyone can benefit
from
your reply.


"Miha Markic [MVP C#]" <miha at rthand com> wrote in message
news:%23cyGEIEuEHA.3200 (AT) TK2MSFTNGP14 (DOT) phx.gbl...
Hi,

I guess you are stuck with manual way.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

"WiZZiX" <wizzix (AT) nospam (DOT) nospam> wrote in message
newsE17B1E4-F7E8-4BC4-9BA6-3067FE93D9C5 (AT) microsoft (DOT) com...
Hello,

My question is quite straightforward:

How do I get the parent row of a deleted (child) row. If I use the
method
"GetParentRow" of the child then it returns "nothing". I have tried
using
the
version parameter of the method but without any result.

I probably could use the original value of the deleted row to
"manually"
go
through the parent rows and find its parent but this seems like a lot
of
work
for something as simple as this.

Hoping for a quick answer,

WiZZiX









Reply With Quote
  #6  
Old   
WiZZiX
 
Posts: n/a

Default Re: How to get the parent of a deleted (child) row - 10-25-2004 , 04:53 AM



Hello both,

Thanks for all the replies.
My stubourness forced me to try getting the parent row again using the
datarowversion parameter of the GetParentRow method. Using original as the
parameter I now did seem to get the parent row and was able to modify it.

I just thought I should mention it althought I am surprised that you did not
correct me by saying it should work in the first place. Am I missing
something here.

Thanks again though,
WiZZiX


"Miha Markic [MVP C#]" wrote:

Quote:
Hi,

I guess you are stuck with manual way.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

"WiZZiX" <wizzix (AT) nospam (DOT) nospam> wrote in message
newsE17B1E4-F7E8-4BC4-9BA6-3067FE93D9C5 (AT) microsoft (DOT) com...
Hello,

My question is quite straightforward:

How do I get the parent row of a deleted (child) row. If I use the method
"GetParentRow" of the child then it returns "nothing". I have tried using
the
version parameter of the method but without any result.

I probably could use the original value of the deleted row to "manually"
go
through the parent rows and find its parent but this seems like a lot of
work
for something as simple as this.

Hoping for a quick answer,

WiZZiX




Reply With Quote
  #7  
Old   
Vincent
 
Posts: n/a

Default RE: How to get the parent of a deleted (child) row - 03-25-2010 , 03:18 AM



if you're working with a dataset obtained through GetChanges(), (deletedrow).GetParentRow(relation,DataRowVersion. Original) won't work if the parent row wasn't modified (which is my case). The only thing I could think of is using FindByID in the original DataSet together with the DataTable.ParentIDColumn DataColumn.

From http://www.developmentnow.com/g/7_2004_10_0_0_1667/How-to-get-the-parent-of-a-deleted-child-row.htm

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com/g/

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.