Serialize DataTable/DataSet

May 9, 2008 at 6:13 PM
Is possible to serialize DbDataTable/DbDataSet? If so, which lib ver!
Have tried straight serialise, but get repeating loop error. Tried Dataset.getXML -> xmldocument then serialize xmldocument/documentelement but then also error.
Do have to write custom serializer?

Coordinator
May 9, 2008 at 10:07 PM
I would imagine so. DataSets aren't the sort of object which would serialize automatically.
If you do write a custom serializer it would be great to post the source so others could also use it.
Jun 2, 2008 at 6:29 PM
I didn't have any problems:

XmlDocument d = new XmlDocument();
d.LoadXml(dt.GetXml());
Response.Write(JavaScriptConvert.SerializeXmlNode(d.ChildNodes[0]));

Works fine here.