Home All Groups Group Topic Archive Search About
Author
13 Apr 2006 7:54 PM
Arne Garvander
How do a serialize a dataset?
I tried
string buf;
buf = mydataset.GetXml();
I got the data but no Schema.
There is a GetXmlSchema, but I want everything together.
Can I append the dataset string to the schema string and get a complete
dataset?

--
Arne Garvander
Certified Geek

Author
14 Apr 2006 4:33 AM
Matt Noonan
This will give you the schema:

   StringWriter writer = new StringWriter();
   XmlSerializer ser = new XmlSerializer(typeof(DataSet));
   ser.Serialize(writer, dataSet);
   return writer.ToString();


--
Matt Noonan
EasyObjects.NET: The O/RM for the Enterprise Library
http://www.easyobjects.net


Show quote
"Arne Garvander" <ArneGarvan***@discussions.microsoft.com> wrote in message
news:5D099EA6-DAA2-409E-BEEF-D20148963871@microsoft.com...
> How do a serialize a dataset?
> I tried
> string buf;
> buf = mydataset.GetXml();
> I got the data but no Schema.
> There is a GetXmlSchema, but I want everything together.
> Can I append the dataset string to the schema string and get a complete
> dataset?
>
> --
> Arne Garvander
> Certified Geek
>

AddThis Social Bookmark Button