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
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