views:

506

answers:

2

I'm looking into changing my application to load its xml format data files into DataTables (and a DataSet?) instead of deserializing them into classes. I can generate a dataset using xsd.exe, but I'm not having any luck finding any examples showing how to use it.

My Google searches have been hopelessly clogged with examples using xsd files as an intermediary in accessing database tables. Since my apps saving data files instead of querying a DB these aren't of any use to me.

+2  A: 

Try out with. May be you need to format your xml.

    DataSet ds = new DataSet();
    ds.ReadXml("xml file path");
Saar
Don't ask me how I failed to find that method with intelisense. I hate Mondays.
Dan Neely
Say Dan - how did you miss that obvious function, even with Intellisense?? (sorry, just couldn't resist <evil grin>)
marc_s
+2  A: 

Is manually filling the schema and table an option?

DataTable table = new DataTable();
table.ReadXmlSchema(xmlReader);
table.ReadXml(xmlReader);
Webleeuw