Groups | Blog | Home
all groups > dotnet ado.net > april 2007 >

dotnet ado.net : Serialize a DataSet to a string?


Chris Davoli
4/19/2007 8:28:05 AM
I have a dataset (with one table in it) that I want to serialize into string
data to store out on a SQL server DB. Here are my questions:

1.) Does anybody have some code that can do this? I saw there was a
serialize method that uses a streamwriter, but I need a code example. ie;
something like this... ViewState("Recipe_DataSet_Table_Serialized") =
gdsDataSet.Tables(0).DataSet.WriteXmlSchema()

2.) What type of field can I use on the database to store a bif xml string
of data?
--
Chris Davoli
Miha Markic
4/19/2007 9:26:03 PM
1) Easiest method: use DataSet.WriteXml
2) I would suggest text or ntext if Sql Server 2000 or xml on Sql Server
2005.

--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

[quoted text, click to view]
AddThis Social Bookmark Button