Anybody know much about serialization?

  • Thread starter Thread starter adouglas
  • Start date Start date
A

adouglas

Guest
Can somebody please tell me if its 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. Im trying to serialize the object using the SoapFormatter object into a MemoryStream object, but that doesnt seem to be quite what I want since I cant 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.
 
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.
 
Back
Top