How to deserialize multiple SQLXML objects in ASP.NET?

D

Don

Hi:

When I read my sqlxml results into a reader and deserialize it, I only get
the first record deserialized into my object.
If I have five records, they're all in the reader. But how do I get access
to all of them via an object or objects?
Do I need an object collection? Here's my XML that comes back from SQL
Server:
<Employees empid="1" lastname="Ng" firstname="William" title="Technical
Consultant" hiredate="01/01/1999"/>
<Employees empid="2" lastname="Tyson" firstname="Mike" title="Accountant"
hiredate="02/03/2001"/>

<Employees empid="3" lastname="Jones" firstname="James" title="Programmer"
hiredate="01/01/2004"/>

<Employees empid="4" lastname="Duong" firstname="Do" title="Programmer"
hiredate="12/02/1998"/>

<Employees empid="5" lastname="Kent" firstname="Moses" title="Manager"
hiredate="12/01/1999"/>

<Employees empid="6" lastname="Henny" firstname="Ray" title="Manager"
hiredate="01/02/2002"/>

Here's my current class:

<XmlRoot("Employees")> Public Class employee

<XmlAttributeAttribute()> Public empid As String = ""

<XmlAttributeAttribute()> Public firstname As String = ""

<XmlAttributeAttribute()> Public lastname As String = ""

<XmlAttributeAttribute()> Public title As String = ""

<XmlAttributeAttribute()> Public hiredate As String = ""

End Class

Thanks,

Don
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top