How to deserialize multiple SQLXML objects in ASP.NET?

Discussion in 'ASP .Net Web Services' started by Don, Sep 17, 2004.

  1. Don

    Don Guest

    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
    Don, Sep 17, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Y2FtcHdlcw==?=
    Replies:
    1
    Views:
    1,721
    =?Utf-8?B?Y2FtcHdlcw==?=
    Oct 29, 2004
  2. Sandy

    JDBC vs SQLXML

    Sandy, Aug 10, 2005, in forum: Java
    Replies:
    0
    Views:
    339
    Sandy
    Aug 10, 2005
  3. JimP
    Replies:
    0
    Views:
    350
  4. [ mcberio ]

    Data.SqlXml not found on Web Service machine

    [ mcberio ], Jul 29, 2003, in forum: ASP .Net Web Services
    Replies:
    3
    Views:
    196
    Dave Beauchemin [MVP]
    Jul 30, 2003
  5. goodmannewz

    use sqlxml access database

    goodmannewz, May 10, 2005, in forum: ASP .Net Web Services
    Replies:
    5
    Views:
    148
    Chad Z. Hower aka Kudzu
    May 11, 2005
Loading...

Share This Page