Re: Deserialize Business Object
- From: "John Saunders" <john.saunders at trizetto.com>
- Date: Tue, 17 Oct 2006 12:09:38 -0400
"Redowl" <Redowl@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:389E3AA4-8276-4E25-9B54-F19B9A4E1AB5@xxxxxxxxxxxxxxxx
John,
Thanks for the response. What I am trying to do is return a business
object
which I then use with XSLT to produce HTML. I am using an XMLReader in
conjunction with the SqlCommand object like so:
' Load data into Reader
Dim XMLR As System.Xml.XmlReader = sqlcom.ExecuteXmlReader
' Create an XmlSerializer
Dim Serializer As New XmlSerializer(GetType(Employee))
' Deserialize the data into the Projects instance
Dim Employee As Employee = CType(Serializer.Deserialize(XMLR),
Employee )
' Close reader
XMLR.Close()
Return Employee
The stored procedure associated with the SqlCommand object is returning
data
using FOR XML. The Employee class has been created using XSD.exe.
Hopefully this has helped?
It has helped, but you still haven't said;
1) What code you execute
2) What exception is thrown
3) What XML you're using
Also, are you returning only one Employee? If so, then I don't see why you
need another root. Why can't you treat Employee as the root, which is what
the XML Serializer will do?
John
.
- References:
- Re: Deserialize Business Object
- From: John Saunders
- Re: Deserialize Business Object
- From: Redowl
- Re: Deserialize Business Object
- Prev by Date: use XmlDataDocument load from an URL with username password
- Next by Date: Re: Inheritied Serializable Classes (OOP Design)
- Previous by thread: Re: Deserialize Business Object
- Next by thread: Re: Deserialize Business Object
- Index(es):
Relevant Pages
|