Code
ListPerson data = new ListPerson
{
Person = new PersonDetails[]
{
new Person
{
Name = "1",
Surename = "2",
Age = "3",
Address = new AddressList[]
{
new Address
{
Name = "5",
Number = "6",
City = "7"
}
}
}
}
};I have this code that i use to built xml with xml serializer and it works good for this example but with fixed values. My question is how can i write some code to make it to take values from dataset. lets say i have two database tables Person And Address and they are connected with id field. One client can have more addresses. As i think i will need to feel dataset with data(and this i know how) and then write a foreach code inside this arrays in order to make it to work.



![[Image: vp6iypF.gif]](https://i.imgur.com/vp6iypF.gif)
![[Image: 2eb99610.gif]](https://i.ibb.co/55SJhvG/2eb99610.gif)