Serializing datasets

  • Thread starter Thread starter Phil Townsend
  • Start date Start date
P

Phil Townsend

I have a unique situation where I need to serialize a dataset to memory
so that it can be inserted into a SQL2005 table with a column having XML
datatype. Some restrictions are preveting me from serializing this to a
file. What would be the best way to go about this? thanks!
 
What restrictions, specifically? And do you really mean a file here?
Have you tried calling GetXml() on the DataSet? Or if you only have a
DataTable you can probably use either a MemoryStream (using the Stream
overload of WriteXml()), or a StringWriter (using the TextWriter
overload of WriteXml()).

Marc
 
Hi,


Phil Townsend said:
I have a unique situation where I need to serialize a dataset to memory
so that it can be inserted into a SQL2005 table with a column having XML
datatype. Some restrictions are preveting me from serializing this to a
file. What would be the best way to go about this? thanks!

What restrictions?

What you mean with serialize it to memory?
How are you declaring the column to hold this value in?

Of course you are using parameters right?


post some code.
 
Back
Top