Click here to Skip to main content
15,911,715 members
Home / Discussions / C#
   

C#

 
QuestionHow to fill a list with a dataset with multiple tables? In C# Pin
Member 1131834917-Dec-14 21:20
Member 1131834917-Dec-14 21:20 
I put an xml file with a structure like this
HTML
<list>
<person>
<name>Micky Mouse</name>
<phone>
<phone1>1111111</phone1>
<phone2>2222222</phone2>
</phone>
</person>
<person>
<name>Donald Duck</name>
<phone>
<phone1>3333333</phone1>
</phone>
</person>
<person>
<name>Pluto</name>
<phone>
</phone>
</person>
<person>
<name>Goofy</name>
<phone>
<phone1>5555555</phone1>
<phone2>6666666</phone2>
<phone3>7777777</phone3>
</phone>
</person>
.....
.....
.....
</list>

into a dataset and then I try to load the dataset into a list. The problem is there are 2 root tables (person and phone) in the main table (list) and I am not sure how to loop through the dataset to fill my list (List<Person> ListP = new List<Person>())
so that the the content of each would match the correct parts.

Example

ListP[0] would contain Micky Mouse, 1111111, 2222222,
ListP[1] would contain Donald Duck 333333
ListP[2] would contain Pluto
ListP[3] would contain Goofy 5555555, 6666666, 7777777

… ect

Thanks for any help

modified 18-Dec-14 4:31am.

AnswerRe: How to fill a list with a dataset with multiple tables? In C# Pin
Freak3017-Dec-14 22:48
Freak3017-Dec-14 22:48 
GeneralRe: How to fill a list with a dataset with multiple tables? In C# Pin
Member 1131834917-Dec-14 23:48
Member 1131834917-Dec-14 23:48 
AnswerRe: How to fill a list with a dataset with multiple tables? In C# Pin
Simon_Whale17-Dec-14 23:58
Simon_Whale17-Dec-14 23:58 
QuestionTask Parrallel Pin
Mycroft Holmes17-Dec-14 15:36
professionalMycroft Holmes17-Dec-14 15:36 
AnswerRe: Task Parrallel Pin
Dave Kreskowiak17-Dec-14 17:29
mveDave Kreskowiak17-Dec-14 17:29 
GeneralRe: Task Parrallel Pin
Mycroft Holmes17-Dec-14 19:07
professionalMycroft Holmes17-Dec-14 19:07 
AnswerRe: Task Parrallel Pin
Kornfeld Eliyahu Peter17-Dec-14 19:53
professionalKornfeld Eliyahu Peter17-Dec-14 19:53 
GeneralRe: Task Parrallel Pin
Mycroft Holmes17-Dec-14 20:16
professionalMycroft Holmes17-Dec-14 20:16 
GeneralRe: Task Parrallel Pin
Kornfeld Eliyahu Peter17-Dec-14 20:23
professionalKornfeld Eliyahu Peter17-Dec-14 20:23 
AnswerRe: Task Parrallel Pin
Agent__00717-Dec-14 20:49
professionalAgent__00717-Dec-14 20:49 
GeneralRe: Task Parrallel Pin
Mycroft Holmes17-Dec-14 21:42
professionalMycroft Holmes17-Dec-14 21:42 
GeneralRe: Task Parrallel Pin
Richard Deeming18-Dec-14 1:34
mveRichard Deeming18-Dec-14 1:34 
GeneralRe: Task Parrallel Pin
Agent__00718-Dec-14 16:21
professionalAgent__00718-Dec-14 16:21 
Questionc# & OAuth2.0 & Google Calendar API v3 Pin
eli123317-Dec-14 12:59
eli123317-Dec-14 12:59 
QuestionHow can I add rows in datagridview in VS? Pin
turbosupramk317-Dec-14 4:28
turbosupramk317-Dec-14 4:28 
GeneralRe: How can I add rows in datagridview in VS? Pin
PIEBALDconsult17-Dec-14 4:34
mvePIEBALDconsult17-Dec-14 4:34 
GeneralRe: How can I add rows in datagridview in VS? Pin
turbosupramk317-Dec-14 4:40
turbosupramk317-Dec-14 4:40 
GeneralRe: How can I add rows in datagridview in VS? Pin
OriginalGriff17-Dec-14 5:20
mveOriginalGriff17-Dec-14 5:20 
GeneralRe: How can I add rows in datagridview in VS? Pin
turbosupramk317-Dec-14 5:29
turbosupramk317-Dec-14 5:29 
GeneralRe: How can I add rows in datagridview in VS? Pin
turbosupramk317-Dec-14 5:48
turbosupramk317-Dec-14 5:48 
GeneralRe: How can I add rows in datagridview in VS? Pin
OriginalGriff17-Dec-14 6:00
mveOriginalGriff17-Dec-14 6:00 
GeneralRe: How can I add rows in datagridview in VS? Pin
turbosupramk317-Dec-14 6:17
turbosupramk317-Dec-14 6:17 
GeneralRe: How can I add rows in datagridview in VS? Pin
OriginalGriff17-Dec-14 6:24
mveOriginalGriff17-Dec-14 6:24 
GeneralRe: How can I add rows in datagridview in VS? Pin
turbosupramk317-Dec-14 7:02
turbosupramk317-Dec-14 7:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.