Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

writing class to xml

Hi,

This is the scenario. A customer has id, name and purchased items. the item has item id and description. Customer can purchse any number of items. for this i have a customer class and item class. i want to produce a xml like following :

<Customers>

<Customer>

<ID>25</ID>

<Name>John</Name>

<Items>

<ItemID>1</ID>

<ItemDescription>Book1</ID>

</Items>

<Items>

<ItemID>2</ID>

<ItemDescription>Book2</ID>

</Items>

</Customer>

<Customer>

<ID>26</ID>

<Name>Tim</Name>

<Items>

<ItemID>4</ID>

<ItemDescription>Book4</ID>

</Items>

<Items>

<ItemID>1</ID>

<ItemDescription>Book1</ID>

</Items>

</Customer>

</Customers>

And i am not getting these values from db. without a dataset will it be possible..?

Thanx.

Arjun.
[1221 byte] By [Arjun] at [2007-11-11 7:32:27]
# 1 Re: writing class to xml
What database are you using & what is the way you are retreiving the data from database(technology wise)?
dev_discuss at 2007-11-11 23:28:41 >