Repost ... anybody??? .... How do I serialize an object to a string?

M

M O J O

Hi,

I need to serialize an object to a string.

In my Desktop applications, I use this function.....

Imports System.Xml.Serialization
Imports System.Xml


Public Shared Function ObjXMLString(ByVal TheObject As Object) As String
Dim serialise As XmlSerializer
Dim ms As New IO.MemoryStream()
Dim s As String

serialise = New XmlSerializer(TheObject.GetType)
serialise.Serialize(ms, TheObject)
s = ByteArrayToString(ms.ToArray())
Return s
End Function


.... but the compact framework doesn't know the XmlSerializer.

How can I serialize an object to a string in compact framework?

Thanks!!!

M O J O
 

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

Top