Jump to content
Xtreme .Net Talk

Recommended Posts

Guest adouglas
Posted

Can somebody please tell me if it's possible to serialize an object into a string (i.e. instead of a file)? I need to serialize an object into a string of XML. I'm trying to serialize the object using the SoapFormatter object into a MemoryStream object, but that doesn't seem to be quite what I want since I can't seem to get a string out of the MemoryStream object. Can somebody give me some example code or point me towards some that shows me how to serialize an object into an XML string?

 

Thanks.

Guest adouglas
Posted
I should have mentioned that the reason I need to do this is so I can then store the resultant string in SQL Server and retrieve it later. Just in case that makes a difference.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...