.NETGURU
Getting a subset from a Dataset in a new Dataset
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.adonet.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Post a new message to this list...

Jan Schoenrock (VIP)
Hello,
I'm facing with the the following problem:

I have dataset with several datatables (5).
The first Table t1 contains the parent objects of the second table t2
(relation) and the second table has parent relations the other 3 tables
(t3,t4,t5).
Now I want to copy only one row of t1 with all sub-elements of the other
tables into a new dataset of the same type.
I found no performant answer to this wish.
May I ask you to help ?

Greetings and thanks in advance Jan
--
Jan Schoenrock, Hamburg, Germany
Reply to this message...
 
    
W.G. Ryan eMVP (VIP)
I'm not sure what you've tried already, but since you have datarelations set
up and you have a DataRow object, have you tried the .GetChildRows method ?
"Jan Schoenrock" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
Jan Schoenrock (VIP)
Thanks for your answer.
Yes I tried the .GetChildRows-Method and thought it will be the way of
choice. But this method returns only an array of rows. There is no overloaded
version which returns a datatable object.
And I did not found a Member of the datatable object which is able to add a
array of rows to the datatable.

When using the .GetChildRows-method i have to loop trough the array and add
child row per child row to the new dataset.
This might be not a very performant approach.

Greetings and thanks for your answer,

Jan

"W.G. Ryan eMVP" wrote:

[Original message clipped]

Reply to this message...
 
    
Jan Schoenrock (VIP)
Hello again,

sorry but now I found the solution for myself.
The right way to copy a subset of a dataset to a new one with the same
Schema is the dataset.merge method.

Greetings Jan

"Jan Schoenrock" wrote:

[Original message clipped]

Reply to this message...
 
 
System.Data.DataRow




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification